shrub/tests/sys/arvo/wa.hoon
fang e888960370
tests: move to root, out of pkg/arvo
Including these in pkg/arvo has caused many minor problems over the
years. We don't want to include them in releases, but this often meant
excluding them manually, which was error-prone.

Here, we move them out of /pkg/arvo/tests and into /tests. CI will have
to be updated to match, since we'll still want to include tests there.
2023-01-18 16:50:42 +01:00

38 lines
917 B
Plaintext

/+ *test
|%
++ test-slam-wa-dry ^- tang
::
%+ expect-eq
!>(7)
-:(~(slam wa *worm) !>(add) !>([3 4]))
:: +test-slam-wa-wet: does +slam:wa perform correct wet type inference?
::
:: Also test that the cache doesn't gain any new entries when given a
:: sample of a previously seen type.
::
++ test-slam-wa-wet ^- tang
:: use the same .list-type for both calls
::
:: Types defined on different lines won't be noun-equal, and so
:: won't test that the cache kicked in on the second entry.
::
=/ list-type=type -:!>(*(list @))
=| worm0=worm
=+ [res1 worm1]=(~(slam wa worm0) !>(flop) [list-type ~[1 2 3]])
=+ [res2 worm2]=(~(slam wa worm1) !>(flop) [list-type ~[4 5 6]])
::
;: weld
%+ expect-eq
res1
[list-type ~[3 2 1]]
::
%+ expect-eq
res2
[list-type ~[6 5 4]]
::
%+ expect-eq
!> worm1
!> worm2
==
--