shrub/tests/new-hoon/myb.hoon
Anton Dyudin d0138ff7fa fix #654 by having assert-eq accept a vase of a pair
flipping the order of the pair while rewriting all the test was necessary anyawy, to accoutn for heavier-twig tendencies
2018-03-09 19:43:35 -08:00

32 lines
690 B
Plaintext

/+ new-hoon, tester
=, myb:new-hoon
|_ _tester:tester
++ test-from-list-null
(expect-eq !>([~ (from-list ~)]))
::
++ test-from-list-real
(expect-eq !>([[~ 5] (from-list [5 ~])]))
::
++ test-to-list-null
(expect-eq !>([~ (to-list ~)]))
::
++ test-to-list-real
(expect-eq !>([[5 ~] (to-list [~ 5])]))
::
++ test-concat-null
(expect-eq !>([~ (concat ~)]))
::
++ test-concat-real
:: wait, if i pull the cast out from below, the concat implementation
:: doesn't compile anymore?
(expect-eq !>([[1 2 ~] (concat `(list (maybe @ud))`[~ [~ 1] ~ [~ 2] ~])]))
::
++ test-map
%- expect-eq !>
:- [2 2 ~]
%+ map:myb
[1 2 3 2 ~]
|=(a/@u ?:(=(2 a) [~ 2] ~))
--