Skip to content

Instantly share code, notes, and snippets.

@Fang-
Created February 13, 2018 20:23
Show Gist options
  • Save Fang-/a585bd75eabda765d49c5bfa8baadd59 to your computer and use it in GitHub Desktop.
Save Fang-/a585bd75eabda765d49c5bfa8baadd59 to your computer and use it in GitHub Desktop.
Terrible beginnings of a neat clay testing lib
::
:::: /lib/test/clay/hoon
::
// /===/sys/vane/clay
=+ cloy=(. !>(..zuse))
::
|%
++ core cloy
++ work
|_ cor/_core
++ do-task
|= a/task:able:clay
^- {(each (list move:cor) tang) _core}
=/ try
=+ coy=(cor ~2017.12.15..23.02.18..f874 `@e`'totally-eny' _~)
(mule |.(~|(task+a (call:coy [/test-clay]~ %noun %soft a))))
?. ?=($& -.try)
[|+p.try cor]
=^ mos cor p.try
[&+mos cor]
--
::
++ test
|= $: cor/_core
tak/task:able:clay
wan/(list gift:able:clay)
==
^- (pair ? _core)
=^ res cor (~(do-task work cor) tak)
:_ cor
?: ?=($| -.res) ~&([%got-error p.res] |)
~& [%got p.res]
.= wan
%+ turn p.res
|= a/move:cor
^- gift:able:clay
?: ?=($give -.q.a) p.q.a
*gift:able:clay
::
++ run
~& %starting
=+ cor=core
=^ res cor
%^ test cor
`task:able:clay`[%cred ~zod %motley [~bud ~ ~]]
[%mack ~]~
~&(%done ~)
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment