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:
Quodss 2023-06-13 18:53:27 +02:00 committed by GitHub
parent be0e8c0a50
commit 3581667798
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

23
tests/sys/hoon/func.hoon Normal file
View 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)
==
::
--