nomsu/lib/testing.nom
2017-12-14 13:57:53 -08:00

14 lines
368 B
Plaintext

require "lib/metaprogramming.nom"
# For unit testing
rule [test tree %generated == %expected] =:
if (%generated != %expected):
error ".."
Test Failed!
Expected:
\(%expected)
But got:
\(%generated)
parse [test %code yields %expected] as:
test tree (nomsu "tree_to_str" [\%code]) == %expected