urbit/pkg/arvo/tests/sys/vane/gall.hoon

81 lines
1.8 KiB
Plaintext
Raw Normal View History

2019-08-23 19:46:57 +03:00
/+ *test
::
2019-11-19 07:36:21 +03:00
/= gall-raw /: /===/sys/vane/gall /!noun/
2019-08-23 19:46:57 +03:00
::
=/ test-pit=vase !>(..zuse)
=/ gall-gate (gall-raw test-pit)
::
|%
:: +test-init: test %init
::
++ test-init
^- tang
::
=/ time ~1111.1.1
::
=/ call-args
=/ =duct ~[/init]
2019-11-19 07:36:21 +03:00
=/ =type -:!>(*task:able:gall)
=/ =task:able:gall [%init ~nec]
2019-08-23 19:46:57 +03:00
[duct type task]
::
=/ expected-moves ~
::
=^ results gall-gate
(gall-call gall-gate time *sley call-args expected-moves)
::
results
:: +test-conf: test %conf
::
++ test-conf
^- tang
::
=/ =duct ~[/init]
=/ time (add ~1111.1.1 ~s1)
=/ =term %my-agent
=/ ship ~nec
::
=/ call-args
2019-11-19 07:36:21 +03:00
=/ =type -:!>(*task:able:gall)
=/ =task:able:gall
2019-08-23 19:46:57 +03:00
=/ =dock [ship term]
[%conf dock dock]
[duct type task]
::
=/ =move:gall-gate
2019-11-20 01:45:41 +03:00
=/ =path /sys/cor/[term]/(scot %p ship)/[term]/(scot %da time)
2019-08-23 19:46:57 +03:00
=/ =note-arvo
2019-11-19 06:28:59 +03:00
=/ =schematic:ford [%core [ship term] /hoon/[term]/app]
2019-08-23 19:46:57 +03:00
=/ =task:able:ford [%build %.y schematic]
[%f task]
[duct %pass path note-arvo]
::
=/ expected-moves=(list move:gall-gate) ~[move]
::
=^ results gall-gate
(gall-call gall-gate time *sley call-args expected-moves)
::
results
:: +gall-call: have %gall run a +task and assert it produces expected-moves
::
++ gall-call
|= $: gall-gate=_gall-gate
now=@da
scry=sley
2019-11-19 07:36:21 +03:00
call-args=[=duct =type wrapped-task=(hobo task:able:gall)]
2019-08-23 19:46:57 +03:00
expected-moves=(list move:gall-gate)
==
^- [tang _gall-gate]
::
=/ gall-core (gall-gate our=~nec now=now eny=`@`0xdead.beef scry=scry)
::
=^ moves gall-gate (call:gall-core call-args)
::
=/ output=tang
%+ expect-eq
!> expected-moves
!> moves
::
[output gall-gate]
--