mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
more modular test headstarts
This commit is contained in:
parent
600dc02a2f
commit
11adf30c72
33
app/ph.hoon
33
app/ph.hoon
@ -63,7 +63,7 @@
|
||||
::
|
||||
:- %hi
|
||||
|%
|
||||
++ ships ~[~bud ~marbud]
|
||||
++ ships ~[~bud ~dev]
|
||||
++ start
|
||||
^- (pair (list ph-event) _..start)
|
||||
:_ ..start
|
||||
@ -80,36 +80,25 @@
|
||||
(expect-dojo-output ~bud who ovo "hi ~dev successful")
|
||||
--
|
||||
::
|
||||
[%headstart-marbud marbud:head-starts]
|
||||
[%headstart-bud (galaxy:head-starts ~bud)]
|
||||
::
|
||||
:- %composed-child-sync
|
||||
%+ compose-tests marbud:head-starts
|
||||
:- %composed-child-boot
|
||||
%+ compose-tests (planet:head-starts ~linnup-torsyx)
|
||||
^- test-core
|
||||
|%
|
||||
++ ships ~[~bud ~marbud ~linnup-torsyx]
|
||||
++ ships ~
|
||||
++ start
|
||||
:_ ..start
|
||||
(init ~linnup-torsyx)
|
||||
[(dojo ~linnup-torsyx "|hi ~bud") ..start]
|
||||
::
|
||||
++ route
|
||||
|= [who=ship ovo=unix-effect]
|
||||
^- (quip ph-event _..start)
|
||||
:_ ..start
|
||||
%- zing
|
||||
:~
|
||||
%- on-dojo-output
|
||||
:^ ~linnup-torsyx who ovo
|
||||
:- "; ~bud is your neighbor"
|
||||
|= ~
|
||||
(dojo ~linnup-torsyx "|hi ~bud")
|
||||
::
|
||||
%- on-dojo-output
|
||||
:^ ~linnup-torsyx who ovo
|
||||
:- "hi ~bud successful"
|
||||
:: :- "; ~bud is your neighbor"
|
||||
|= ~
|
||||
[%test-done &]~
|
||||
==
|
||||
%- on-dojo-output
|
||||
:^ ~linnup-torsyx who ovo
|
||||
:- "hi ~bud successful"
|
||||
|= ~
|
||||
[%test-done &]~
|
||||
--
|
||||
::
|
||||
:- %child-sync
|
||||
|
56
lib/ph.hoon
56
lib/ph.hoon
@ -138,35 +138,67 @@
|
||||
::
|
||||
++ head-starts
|
||||
|%
|
||||
++ marbud
|
||||
:: Don't use directly, or else you might not have a parent.
|
||||
::
|
||||
:: Consider ++galaxy, ++star, ++planet, and ++ship-with-ancestors.
|
||||
::
|
||||
++ raw-ship
|
||||
|= her=ship
|
||||
^- test-core
|
||||
|%
|
||||
++ ships ~[~bud ~marbud]
|
||||
++ ships ~[her]
|
||||
++ start
|
||||
^- (quip ph-event _..start)
|
||||
:_ ..start
|
||||
%- zing
|
||||
:~ (init ~bud)
|
||||
==
|
||||
[(init her) ..start]
|
||||
::
|
||||
++ route
|
||||
|= [who=ship ovo=unix-effect]
|
||||
^- (quip ph-event _..start)
|
||||
:_ ..start
|
||||
%- zing
|
||||
:: This is a pretty bad heuristic, but in general galaxies will
|
||||
:: hit the first of these cases, and other ships will hit the
|
||||
:: second.
|
||||
::
|
||||
:~
|
||||
%- on-dojo-output
|
||||
:^ ~bud who ovo
|
||||
:- "+ /~bud/base/2/web/testing/udon"
|
||||
:^ her who ovo
|
||||
:- "+ /{(scow %p her)}/base/2/web/testing/udon"
|
||||
|= ~
|
||||
(init ~marbud)
|
||||
[%test-done &]~
|
||||
::
|
||||
%- on-dojo-output
|
||||
:^ ~marbud who ovo
|
||||
:- "; ~bud is your neighbor"
|
||||
:^ her who ovo
|
||||
:- "is your neighbor"
|
||||
|= ~
|
||||
[%test-done &]~
|
||||
==
|
||||
--
|
||||
--
|
||||
++ galaxy
|
||||
|= her=ship
|
||||
?> =(%czar (clan:title her))
|
||||
(raw-ship her)
|
||||
::
|
||||
++ star
|
||||
|= her=ship
|
||||
?> =(%king (clan:title her))
|
||||
%+ compose-tests (galaxy (^sein:title her))
|
||||
(raw-ship her)
|
||||
::
|
||||
++ planet
|
||||
|= her=ship
|
||||
?> =(%duke (clan:title her))
|
||||
%+ compose-tests (star (^sein:title her))
|
||||
(raw-ship her)
|
||||
::
|
||||
++ ship-with-ancestors
|
||||
|= her=ship
|
||||
%. her
|
||||
?- (clan:title her)
|
||||
%czar galaxy
|
||||
%king star
|
||||
%duke planet
|
||||
%earl ~|(%moon-not-implemented !!)
|
||||
%pawn ~|(%comet-not-implemented !!)
|
||||
==
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user