From 081f01ab4e2e2ee21d45714d1a6810c3ee1b2e20 Mon Sep 17 00:00:00 2001 From: Dan White Date: Fri, 20 Feb 2015 09:38:16 -0600 Subject: [PATCH] test documentation --- msp4th/tests.4th | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/msp4th/tests.4th b/msp4th/tests.4th index f3e4ac2..dc423f1 100644 --- a/msp4th/tests.4th +++ b/msp4th/tests.4th @@ -1,17 +1,18 @@ \ vim: ft=forth -: .. +: .. ( -- ) \ print TOS without consuming dup . ; -: fail ( -- ) +: fail ( -- ) \ print "FAIL" 0x46 emit 0x41 emit 0x49 emit 0x4c emit cr ; : cmp ( a b -- ) == not if fail s. then ; -: scmp ( x*2n n -- ) \ verify stack contents match +: scmp ( x*2n n -- ) \ verify n stack entries match, or are repeated 0 swap do - i roll cmp - -1 +loop ; + i roll cmp + -1 + +loop ; 5 6 7 8 5 6 7 8 4 scmp \ case 1: // bye -- 2.25.1