mirror of
https://github.com/urbit/shrub.git
synced 2024-11-24 04:58:08 +03:00
Add regression tests
Added regression tests as asked by @joemfb to test that currying and composition gates strip faces and that the subject of a gate returned by ++curr nests under the head of curried gate's subject.
This commit is contained in:
parent
be0e8c0a50
commit
3581667798
23
tests/sys/hoon/func.hoon
Normal file
23
tests/sys/hoon/func.hoon
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
:: Tests for currying gates and ++corl
|
||||||
|
::
|
||||||
|
/+ *test
|
||||||
|
|%
|
||||||
|
++ test-func
|
||||||
|
;: weld
|
||||||
|
%+ expect-eq
|
||||||
|
!> `(list)`~[0 1 2]
|
||||||
|
!> ((curr oust `(list)`~[0 1 2]))
|
||||||
|
%+ expect-eq
|
||||||
|
!> `@`6
|
||||||
|
!> ((curr roll add) (gulf 1 3))
|
||||||
|
%+ expect-eq
|
||||||
|
!> `@`6
|
||||||
|
!> ((cury roll (gulf 1 3)) add)
|
||||||
|
:: check that ++corl strips face from b's subject
|
||||||
|
::
|
||||||
|
%+ expect-eq
|
||||||
|
!> `@`15
|
||||||
|
!> ((corl same (cury roll (gulf 1 5))) add)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
--
|
Loading…
Reference in New Issue
Block a user