mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 20:04:09 +03:00
48585d2b2f
+test now offloads creation of the test tree into a renderer. this should help with caching. using a renderer also lets us deal with hierarchical directory structures, leading to better organization.
33 lines
564 B
Plaintext
33 lines
564 B
Plaintext
:: tests for the either core.
|
|
/+ new-hoon, tester
|
|
=, thr:new-hoon
|
|
=/ data/(list (either @u tape)) [[%& 1] [%| "one"] [%& 2] [%| "two"] ~]
|
|
|_ tester-type:tester
|
|
++ test-apply
|
|
%^ expect-eq
|
|
%^ apply
|
|
`(either @u tape)`[%| "one"]
|
|
|=(a/@u "left")
|
|
|=(b/tape "right")
|
|
"right"
|
|
"apply"
|
|
::
|
|
++ test-firsts
|
|
%^ expect-eq
|
|
(firsts data)
|
|
[1 2 ~]
|
|
"firsts"
|
|
::
|
|
++ test-seconds
|
|
%^ expect-eq
|
|
(seconds data)
|
|
["one" "two" ~]
|
|
"seconds"
|
|
::
|
|
++ test-partition
|
|
%^ expect-eq
|
|
(partition data)
|
|
[[1 2 ~] ["one" "two" ~]]
|
|
"partition"
|
|
--
|