nomsu/lib/testing.nom

14 lines
373 B
Plaintext
Raw Normal View History

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