mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-22 14:21:34 +03:00
73 lines
1.5 KiB
Plaintext
73 lines
1.5 KiB
Plaintext
/+ *test
|
|
/= gall-raw /sys/vane/gall
|
|
::
|
|
=/ gall-gate (gall-raw ~nec)
|
|
::
|
|
|%
|
|
:: +test-init: test %init
|
|
::
|
|
++ test-init
|
|
^- tang
|
|
::
|
|
=/ time ~1111.1.1
|
|
::
|
|
=/ call-args
|
|
=/ =duct ~[/init]
|
|
=/ =task:gall [%init ~]
|
|
[duct task]
|
|
::
|
|
=/ expected-moves=(list move:gall-gate) ~
|
|
::
|
|
=/ res
|
|
(gall-call gall-gate time *roof call-args expected-moves)
|
|
::
|
|
-.res
|
|
:: +test-jolt: test %jolt; TODO: test clay response
|
|
::
|
|
++ test-jolt
|
|
^- tang
|
|
::
|
|
=/ =duct ~[/init]
|
|
=/ time (add ~1111.1.1 ~s1)
|
|
=/ dap=term %my-agent
|
|
=/ ship ~nec
|
|
::
|
|
=/ call-args
|
|
=/ =task:gall [%jolt %base dap]
|
|
[duct task]
|
|
::
|
|
=/ =move:gall-gate
|
|
=/ =wire /sys/cor/[dap]/(scot %p ship)/base/(scot %da time)
|
|
=/ =note-arvo
|
|
[%c %warp ship %base ~ %sing %a da+time /app/[dap]/hoon]
|
|
[duct %pass wire note-arvo]
|
|
::
|
|
=/ expected-moves=(list move:gall-gate) ~[move]
|
|
::
|
|
=/ res
|
|
(gall-call gall-gate time *roof call-args expected-moves)
|
|
::
|
|
-.res
|
|
:: +gall-call: have %gall run a +task and assert it produces expected-moves
|
|
::
|
|
++ gall-call
|
|
|= $: gall-gate=_gall-gate
|
|
now=@da
|
|
scry=roof
|
|
call-args=[=duct wrapped-task=(hobo task:gall)]
|
|
expected-moves=(list move: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]
|
|
--
|