From f2b85df948cb837ab8217df706104cb7ea1d9ff9 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 17 Aug 2022 17:24:51 +0300 Subject: [PATCH] tests: initial setup for gall and ames on two ships --- pkg/arvo/tests/sys/grq.hoon | 2 +- pkg/base-dev/lib/vane-test.hoon | 42 +++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/tests/sys/grq.hoon b/pkg/arvo/tests/sys/grq.hoon index f0054cd54..34c001830 100644 --- a/pkg/arvo/tests/sys/grq.hoon +++ b/pkg/arvo/tests/sys/grq.hoon @@ -3,7 +3,7 @@ /+ *test, vane-test |% ++ test-nec-bud - =+ ames-nec-bud:vane-test + =+ nec-bud:vane-test ;: weld %+ expect-eq !> nec diff --git a/pkg/base-dev/lib/vane-test.hoon b/pkg/base-dev/lib/vane-test.hoon index 7a1e9842d..8fc078b77 100644 --- a/pkg/base-dev/lib/vane-test.hoon +++ b/pkg/base-dev/lib/vane-test.hoon @@ -1,8 +1,39 @@ /+ *test -/= ames /sys/vane/ames -/= jael /sys/vane/jael +/= ames /sys/vane/ames +/= gall-raw /sys/vane/gall +:: +=/ gall-bunt (gall-raw ~zod) :: |% +++ gall-gate _(make-gall ~zod) +++ nec-bud + =/ a ames-nec-bud + :* nec=[ames=nec.a gall=(make-gall ~nec)] + bud=[ames=bud.a gall=(make-gall ~bud)] + == +:: +gall-call: have %gall run a +task and assert it produces expected-moves +:: +++ gall-call + |= $: =gall-gate + now=@da + scry=roof + call-args=[=duct wrapped-task=(hobo task:gall)] + expected-moves=(list move:gall-bunt) + == + ^- [tang ^gall-gate] + =/ gall-core (gall-gate now=now eny=`@`0xdead.beef scry=scry) + :: + =/ res + =/ =type -:!>(*task:gall) + (call:gall-core duct.call-args dud=~ wrapped-task.call-args) + :: + =/ output=tang + %+ expect-eq + !> expected-moves + !> -.res + :: + [output +.res] +:: ++ ames-nec-bud :: create ~nec :: @@ -62,4 +93,11 @@ => .(bud +:(call:(bud) ~[//unix] ~ %born ~)) :: [nec=nec bud=bud] +:: +++ make-gall + |= =ship + =/ gall-pupa (gall-raw ship) + =/ gall-core (gall-pupa now=~1111.1.1 eny=`@`0xdead.beef scry=*roof) + =+ [out adult]=(call:gall-core duct=~[/init] dud=~ task=[%init ~]) + adult --