mirror of
https://github.com/urbit/shrub.git
synced 2025-01-02 17:43:32 +03:00
add test for sudden breaches
This commit is contained in:
parent
582ac471bd
commit
583da25e50
@ -335,7 +335,7 @@
|
||||
|= [=pending-udiffs =number:block]
|
||||
=/ m (async:stdio ,^pending-udiffs)
|
||||
^- form:m
|
||||
=/ rel-number (sub number 30)
|
||||
=/ rel-number (sub number 1)
|
||||
=/ =udiffs:point (~(get ja pending-udiffs) rel-number)
|
||||
;< ~ bind:m (jael-update udiffs)
|
||||
(pure:m (~(del by pending-udiffs) rel-number))
|
||||
|
@ -245,6 +245,38 @@
|
||||
(check-file-touched ~marbud %home file)
|
||||
~& > 'DONE DONE'
|
||||
(pure:m ~)
|
||||
::
|
||||
:+ %breach-sudden
|
||||
~[~bud ~marbud]
|
||||
=. eth-node (spawn:eth-node ~marbud)
|
||||
=. eth-node (spawn:eth-node ~fipfes)
|
||||
;< [eth-node=_eth-node ~] bind:m
|
||||
%+ (wrap-philter ,_eth-node ,~)
|
||||
router:eth-node
|
||||
;< ~ bind:m (raw-ship ~bud `(dawn:eth-node ~bud))
|
||||
~& > 'BUD DONE'
|
||||
;< ~ bind:m (raw-ship ~marbud `(dawn:eth-node ~marbud))
|
||||
~& > 'MARBUD DONE'
|
||||
;< file=@t bind:m (touch-file ~bud %base)
|
||||
~& > 'TOUCH FILE DONE'
|
||||
(check-file-touched ~marbud %home file)
|
||||
~& > 'TOUCH FILE CHECK DONE'
|
||||
=. eth-node (breach:eth-node ~bud)
|
||||
~& > 'BREACH EXECUTED'
|
||||
;< [eth-node=_eth-node ~] bind:m
|
||||
%+ (wrap-philter ,_eth-node ,~)
|
||||
router:eth-node
|
||||
;< ~ bind:m (raw-ship ~bud `(dawn:eth-node ~bud))
|
||||
~& > 'BUD RE DONE'
|
||||
;< ~ bind:m (just-events (dojo ~bud "|merge %base ~marbud %kids, =gem %this"))
|
||||
~& > 'THIS MERGE STARTED DONE'
|
||||
;< file=@t bind:m (touch-file ~bud %base)
|
||||
~& > 'TOUCH-1 DONE'
|
||||
;< file=@t bind:m (touch-file ~bud %base)
|
||||
~& > 'TOUCH-2 DONE'
|
||||
(check-file-touched ~marbud %home file)
|
||||
~& > 'DONE DONE'
|
||||
(pure:m ~)
|
||||
==
|
||||
::
|
||||
++ install-tests
|
||||
|
@ -361,7 +361,6 @@
|
||||
++ breach-and-hear
|
||||
|= [our=@p who=@p her=@p]
|
||||
=. this-az (breach who)
|
||||
=. this-az ?:((~(has by lives) ~fes) (cycle-keys ~fes) (spawn ~fes))
|
||||
=/ new-rut rut:(~(got by lives) who)
|
||||
=/ m (ph ,_this-az)
|
||||
;< [this-az=_this-az ~] bind:m
|
||||
@ -385,9 +384,11 @@
|
||||
=/ prev (~(got by lives) who)
|
||||
=/ rut +(rut.prev)
|
||||
=. lives (~(put by lives) who [lyfe.prev rut])
|
||||
%- add-logs
|
||||
:_ ~
|
||||
(broke-continuity:lo who rut)
|
||||
=. this-az
|
||||
%- add-logs
|
||||
:_ ~
|
||||
(broke-continuity:lo who rut)
|
||||
?:((~(has by lives) ~fes) (cycle-keys ~fes) (spawn ~fes))
|
||||
::
|
||||
++ get-keys
|
||||
|= [who=@p lyfe=life]
|
||||
|
Loading…
Reference in New Issue
Block a user