urbit/tests/sys/vane/ames.hoon

48 lines
1001 B
Plaintext
Raw Normal View History

2018-09-07 06:47:33 +03:00
/+ *test
::
/= ames-raw /: /===/sys/vane/ames
/!noun/
=/ type-spear -:!>(ames-raw)
::
=/ test-pit=vase !>(.)
=/ ames-gate (ames-raw test-pit)
::
|%
:: tests that %ames asks for private keys on %init
::
++ test-init
=^ results1 ames-gate
=/ hen=duct
[/ /term/1 / ~]
=/ wir=wire
/our/~nul
2018-09-07 06:47:33 +03:00
%- ames-call
:* ames-gate
now=~1234.5.6
call-args=[hen type=*type %soft %init ~nul]
2018-12-12 11:50:40 +03:00
[[hen %pass wir %j %vein ~] [hen %pass / %j %turf ~] ~]
2018-09-07 06:47:33 +03:00
==
::
results1
::
++ ames-call
|= $: ames-gate=_ames-gate
now=@da
call-args=[=duct wrapped-task=(hypo (hobo task:able:ames-gate))]
expected-moves=(list move:ames-gate)
==
^- [tang _ames-gate]
::
2018-12-12 11:50:40 +03:00
=/ ames (ames-gate our=~nul now=now eny=`@`0xdead.beef scry=*sley)
2018-09-07 06:47:33 +03:00
::
=^ moves ames-gate
%- call:ames call-args
::
=/ output=tang
%+ expect-eq
!> expected-moves
!> moves
::
[output ames-gate]
--