add test for sudden breaches

This commit is contained in:
Philip Monk 2019-07-30 16:53:40 -07:00
parent 582ac471bd
commit 583da25e50
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
3 changed files with 38 additions and 5 deletions

View File

@ -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))

View File

@ -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

View File

@ -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]