mirror of
https://github.com/urbit/shrub.git
synced 2024-12-30 07:35:19 +03:00
test: khan test cleanup
;;(vase ...) does a nest-check of the type of the kernel. This is undesirable, so we instead run everything through +slum and cast the result to +tang.
This commit is contained in:
parent
21ea32e8ad
commit
ccf9110f7f
@ -2,7 +2,7 @@
|
|||||||
/= khan-raw /sys/vane/khan
|
/= khan-raw /sys/vane/khan
|
||||||
=/ khan-gate (khan-raw ~nul)
|
=/ khan-gate (khan-raw ~nul)
|
||||||
|%
|
|%
|
||||||
++ test-khan-fyrd-basic
|
++ test-khan-fyrd-start-args
|
||||||
=^ results1 khan-gate
|
=^ results1 khan-gate
|
||||||
%- khan-call :*
|
%- khan-call :*
|
||||||
khan-gate
|
khan-gate
|
||||||
@ -21,8 +21,8 @@
|
|||||||
%nonexistent (vale.dais ~)
|
%nonexistent (vale.dais ~)
|
||||||
==
|
==
|
||||||
=^ results2 khan-gate
|
=^ results2 khan-gate
|
||||||
%- khan-call :*
|
%- khan-call
|
||||||
khan-gate
|
:* khan-gate
|
||||||
now
|
now
|
||||||
scry=scry-provides-mark
|
scry=scry-provides-mark
|
||||||
^= call-args
|
^= call-args
|
||||||
@ -32,6 +32,7 @@
|
|||||||
^= moves-check
|
^= moves-check
|
||||||
|= mev=(list move:khan-gate)
|
|= mev=(list move:khan-gate)
|
||||||
^- tang
|
^- tang
|
||||||
|
=/ r0 (expect-eq !>(2) !>((lent mev)))
|
||||||
=/ r1
|
=/ r1
|
||||||
%+ expect-eq
|
%+ expect-eq
|
||||||
!> :* ~[//khan/1/0vsome.ductt]
|
!> :* ~[//khan/1/0vsome.ductt]
|
||||||
@ -40,12 +41,13 @@
|
|||||||
/thread-result/'khan-fyrd--0vsome.ductt'
|
/thread-result/'khan-fyrd--0vsome.ductt'
|
||||||
==
|
==
|
||||||
!> (head mev)
|
!> (head mev)
|
||||||
:: XX this is extremely verbose because we do not have
|
:: XX this is somewhat verbose because we do not
|
||||||
:: a +expect-eq for recursive vases, and spider takes a
|
:: have a +expect-eq for recursive vases, and spider
|
||||||
:: double-nested vase. so we first test that the poke is
|
:: takes a double-nested vase. so we first test that
|
||||||
:: correct aside from the vase; then we check that the
|
:: the poke is correct aside from the vase; then we
|
||||||
:: outer vase is correct aside from the inner vase; then
|
:: check that the outer vase is correct aside from
|
||||||
:: we check that the inner vase is correct.
|
:: the inner vase; then we check that the inner vase
|
||||||
|
:: is correct.
|
||||||
::
|
::
|
||||||
=/ rem (rear mev)
|
=/ rem (rear mev)
|
||||||
=/ r2
|
=/ r2
|
||||||
@ -56,16 +58,19 @@
|
|||||||
%spider-start ~
|
%spider-start ~
|
||||||
==
|
==
|
||||||
!> rem(+1023 ~)
|
!> rem(+1023 ~)
|
||||||
=/ vez=vase ;;(vase +1023:(rear mev))
|
=/ vez=* +1023:(rear mev)
|
||||||
=/ r3
|
=/ r3
|
||||||
%+ expect-eq
|
;; tang
|
||||||
!> args(+31 ~)
|
%+ slum expect-eq
|
||||||
!> q.vez(+31 ~)
|
:- !> args(+31 ~)
|
||||||
|
!> +.vez(+31 ~)
|
||||||
=/ r4
|
=/ r4
|
||||||
%+ expect-eq
|
;; tang
|
||||||
;;(vase +31.args)
|
%+ slum expect-eq
|
||||||
;;(vase +31.q.vez)
|
:- +31.args
|
||||||
|
+31.+.vez
|
||||||
;: weld
|
;: weld
|
||||||
|
r0
|
||||||
r1
|
r1
|
||||||
r2
|
r2
|
||||||
r3
|
r3
|
||||||
@ -84,12 +89,19 @@
|
|||||||
|= $: khan-gate=_khan-gate
|
|= $: khan-gate=_khan-gate
|
||||||
now=@da
|
now=@da
|
||||||
scry=roof
|
scry=roof
|
||||||
call-args=[=duct dud=(unit goof) wrapped-task=(hobo task:khan)]
|
$= call-args
|
||||||
moves-check=$-((list move:khan-gate) tang)
|
$: =duct
|
||||||
|
dud=(unit goof)
|
||||||
|
wrapped-task=(hobo task:khan)
|
||||||
|
==
|
||||||
|
$= moves-check
|
||||||
|
$- (list move:khan-gate) tang
|
||||||
==
|
==
|
||||||
^- [tang _khan-gate]
|
^- [tang _khan-gate]
|
||||||
=/ khan-core (khan-gate now eny=`@uvJ`0xdead.beef scry=scry)
|
=/ khan-core
|
||||||
=^ moves khan-gate (call:khan-core [duct dud wrapped-task]:call-args)
|
(khan-gate now eny=`@uvJ`0xdead.beef scry=scry)
|
||||||
|
=^ moves khan-gate
|
||||||
|
(call:khan-core [duct dud wrapped-task]:call-args)
|
||||||
=/ output=tang
|
=/ output=tang
|
||||||
(moves-check moves)
|
(moves-check moves)
|
||||||
[output khan-gate]
|
[output khan-gate]
|
||||||
|
Loading…
Reference in New Issue
Block a user