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
|
|
|
::
|
|
|
|
=/ 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]
|
|
|
|
::
|
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
|
2019-08-23 19:46:57 +03:00
|
|
|
(gall-call gall-gate time *sley call-args expected-moves)
|
|
|
|
::
|
2020-05-20 11:22:40 +03:00
|
|
|
-.res
|
|
|
|
:: +test-conf: test %conf; TODO: test clay response
|
2019-08-23 19:46:57 +03:00
|
|
|
::
|
|
|
|
++ test-conf
|
|
|
|
^- 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
|
2019-11-19 07:36:21 +03:00
|
|
|
=/ =type -:!>(*task:able:gall)
|
2020-04-30 01:11:37 +03:00
|
|
|
=/ =task:able:gall [%conf dap]
|
2019-08-23 19:46:57 +03:00
|
|
|
[duct type task]
|
|
|
|
::
|
|
|
|
=/ =move:gall-gate
|
2020-04-30 01:11:37 +03:00
|
|
|
=/ =wire /sys/cor/[dap]/(scot %p ship)/home/(scot %da time)
|
2019-08-23 19:46:57 +03:00
|
|
|
=/ =note-arvo
|
2020-04-30 01:11:37 +03:00
|
|
|
[%c %warp ship %home ~ %sing %a da+time /app/[dap]/hoon]
|
|
|
|
[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
|
2019-08-23 19:46:57 +03:00
|
|
|
(gall-call gall-gate time *sley call-args expected-moves)
|
|
|
|
::
|
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=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)
|
|
|
|
==
|
|
|
|
=/ gall-core (gall-gate our=~nec now=now eny=`@`0xdead.beef scry=scry)
|
|
|
|
::
|
2020-05-20 11:22:40 +03:00
|
|
|
=/ res
|
|
|
|
=/ =type -:!>(*task:able:gall)
|
|
|
|
(call:gall-core duct.call-args dud=~ type 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
|
|
|
--
|