shrub/tests/sys/vane/gall.hoon

47 lines
955 B
Plaintext
Raw Normal View History

2019-08-23 19:46:57 +03:00
/+ *test
2020-04-19 03:01:26 +03:00
/= gall-raw /sys/vane/gall
2019-08-23 19:46:57 +03:00
::
2020-12-06 11:38:37 +03:00
=/ gall-gate (gall-raw ~nec)
2019-08-23 19:46:57 +03:00
::
|%
:: +test-init: test %init
::
++ test-init
^- tang
::
=/ time ~1111.1.1
::
=/ call-args
=/ =duct ~[/init]
2020-12-08 03:47:06 +03:00
=/ =task:gall [%init ~]
2020-12-06 11:38:37 +03:00
[duct task]
2019-08-23 19:46:57 +03:00
::
2020-05-20 11:22:40 +03:00
=/ expected-moves=(list move:gall-gate) ~
2019-08-23 19:46:57 +03:00
::
2020-05-20 11:22:40 +03:00
=/ res
(gall-call gall-gate time *roof call-args expected-moves)
2019-08-23 19:46:57 +03:00
::
2020-05-20 11:22:40 +03:00
-.res
2019-08-23 19:46:57 +03:00
:: +gall-call: have %gall run a +task and assert it produces expected-moves
::
++ gall-call
|= $: gall-gate=_gall-gate
now=@da
scry=roof
2020-12-08 03:47:06 +03:00
call-args=[=duct wrapped-task=(hobo task:gall)]
2019-08-23 19:46:57 +03:00
expected-moves=(list move:gall-gate)
==
2020-12-06 11:38:37 +03:00
=/ gall-core (gall-gate now=now eny=`@`0xdead.beef scry=scry)
2019-08-23 19:46:57 +03:00
::
2020-05-20 11:22:40 +03:00
=/ res
2020-12-08 03:47:06 +03:00
=/ =type -:!>(*task:gall)
2020-12-06 11:38:37 +03:00
(call:gall-core duct.call-args dud=~ wrapped-task.call-args)
2019-08-23 19:46:57 +03:00
::
=/ output=tang
%+ expect-eq
!> expected-moves
2020-05-20 11:22:40 +03:00
!> -.res
2019-08-23 19:46:57 +03:00
::
2020-05-20 11:22:40 +03:00
[output +.res]
2019-08-23 19:46:57 +03:00
--