1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-01 17:10:56 +11:00
collapseos/tests/harness.fs
Virgil Dupras 527f5977d7 Add BS, CR, LF, SPC ASCII consts
Previously, these words would be ascii emitters, but seldom used
except for the SPC emitter. However, I would often end up hardcoding
these constants. With useless emitters removed and ASCII constants
added, we have a more usable system.

Also, fix broken test harness.
2021-01-02 10:26:05 -05:00

10 lines
260 B
Forth

( Forth testing harness
"#" means "assert". We stop at first failure, indicating
the failure through IO on port 1 )
: fail SPC> ." failed" NL> 1 1 PC! BYE ;
: # IF SPC> ." pass" NL> ELSE fail THEN ;
: #eq 2DUP SWAP . SPC> '=' EMIT SPC> . '?' EMIT = # ;