shrub/pkg/arvo/tests/sys/vane/ames.hoon
Jared Tobin b3901ab42f Add 'pkg/arvo/' from commit 'c20e2a185f131ff3f5d3961829bd7a3fe0f227f8'
git-subtree-dir: pkg/arvo
git-subtree-mainline: 9c8f40bf6c
git-subtree-split: c20e2a185f
2019-06-28 12:48:05 +08:00

48 lines
1001 B
Plaintext

/+ *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
%- ames-call
:* ames-gate
now=~1234.5.6
call-args=[hen type=*type %soft %init ~nul]
[[hen %pass wir %j %vein ~] [hen %pass / %j %turf ~] ~]
==
::
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]
::
=/ ames (ames-gate our=~nul now=now eny=`@`0xdead.beef scry=*sley)
::
=^ moves ames-gate
%- call:ames call-args
::
=/ output=tang
%+ expect-eq
!> expected-moves
!> moves
::
[output ames-gate]
--