2017-09-21 00:10:26 -07:00
|
|
|
require "lib/metaprogramming.nom"
|
|
|
|
|
|
|
|
# For unit testing
|
2017-10-02 17:21:22 -07:00
|
|
|
rule [test tree %generated == %expected] =:
|
2017-09-21 00:10:26 -07:00
|
|
|
if (%generated != %expected):
|
2017-10-02 17:21:22 -07:00
|
|
|
error ".."
|
2017-12-14 13:57:53 -08:00
|
|
|
Test Failed!
|
|
|
|
Expected:
|
|
|
|
\(%expected)
|
|
|
|
But got:
|
|
|
|
\(%generated)
|
2017-10-02 17:21:22 -07:00
|
|
|
parse [test %code yields %expected] as:
|
|
|
|
test tree (nomsu "tree_to_str" [\%code]) == %expected
|