1
1
mirror of https://github.com/urbit/shrub.git synced 2024-12-28 22:54:15 +03:00
shrub/pkg/arvo/tests/sys/vane/gall.hoon

73 lines
1.5 KiB
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
:: +test-jolt: test %jolt; TODO: test clay response
2019-08-23 19:46:57 +03:00
::
++ test-jolt
2019-08-23 19:46:57 +03:00
^- tang
::
=/ =duct ~[/init]
=/ time (add ~1111.1.1 ~s1)
2020-04-30 01:11:37 +03:00
=/ dap=term %my-agent
2019-08-23 19:46:57 +03:00
=/ ship ~nec
::
=/ call-args
2021-09-17 07:51:19 +03:00
=/ =task:gall [%jolt %base dap]
2020-12-06 11:38:37 +03:00
[duct task]
2019-08-23 19:46:57 +03:00
::
=/ =move:gall-gate
2021-09-17 07:51:19 +03:00
=/ =wire /sys/cor/[dap]/(scot %p ship)/base/(scot %da time)
2019-08-23 19:46:57 +03:00
=/ =note-arvo
2021-09-17 07:51:19 +03:00
[%c %warp ship %base ~ %sing %a da+time /app/[dap]/hoon]
2020-04-30 01:11:37 +03:00
[duct %pass wire note-arvo]
2019-08-23 19:46:57 +03:00
::
=/ expected-moves=(list move:gall-gate) ~[move]
::
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
--