2020-03-19 15:43:48 -04:00
|
|
|
( Forth testing harness
|
|
|
|
"#" means "assert". We stop at first failure, indicating
|
|
|
|
the failure through IO on port 1 )
|
|
|
|
|
2021-01-02 10:19:42 -05:00
|
|
|
: fail SPC> ." failed" NL> 1 1 PC! BYE ;
|
2020-03-19 15:43:48 -04:00
|
|
|
|
2021-01-02 10:19:42 -05:00
|
|
|
: # IF SPC> ." pass" NL> ELSE fail THEN ;
|
2020-03-19 15:43:48 -04:00
|
|
|
|
2021-01-02 10:19:42 -05:00
|
|
|
: #eq 2DUP SWAP . SPC> '=' EMIT SPC> . '?' EMIT = # ;
|