add a few more tests

FossilOrigin-Name: 8151d9ebf6d31952626837155c7dc8345b04199a9cdf7e15a6756d11babd883c
This commit is contained in:
crc 2019-10-14 20:12:56 +00:00
parent 36c8929528
commit da87f3d7fe

View file

@ -31,15 +31,20 @@ This will count the number of successful tests.
'Flag var 'Flag var
'Tests var 'Tests var
'InTestState var 'InTestState var
:Testing (s-) :Testing (s-)
'Test:__ s:put s:put nl #-1 !Flag #0 !Tests &WordsTested v:inc reset ; 'Test:__ s:put s:put nl #-1 !Flag #0 !Tests &WordsTested v:inc reset ;
:passed (-) :passed (-)
'->_ s:put @Tests n:put '_tests_passed s:put nl '->_ s:put @Tests n:put '_tests_passed s:put nl
'----------------------------------- s:put nl ; '----------------------------------- s:put nl ;
:exit-on-fail (-) :exit-on-fail (-)
@Flag [ passed '->_1_test_failed s:put nl err:die ] -if ; @Flag [ passed '->_1_test_failed s:put nl err:die ] -if ;
:match (n-) :match (n-)
eq? @InTestState and !InTestState ; eq? @InTestState and !InTestState ;
:try (qq-) :try (qq-)
#-1 !InTestState #-1 !InTestState
[ call ] dip call [ call ] dip call
@ -81,6 +86,8 @@ passed
~~~ ~~~
'; Testing '; Testing
[ here &; call here swap - ] [ #1 eq? ] try
[ here &; call fetch ] [ #10 eq? ] try
passed passed
~~~ ~~~
@ -144,6 +151,8 @@ passed
~~~ ~~~
'0; Testing '0; Testing
[ #1 0; #2 0; ] [ #2 eq? swap #1 eq? and ] try
[ #1 0; #0 0; #2 0; ] [ #1 eq? ] try
passed passed
~~~ ~~~
@ -2057,6 +2066,7 @@ passed
~~~ ~~~
'TRUE Testing 'TRUE Testing
[ TRUE ] [ #-1 eq? ] try
passed passed
~~~ ~~~
@ -2202,7 +2212,7 @@ passed
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
~~~ ~~~
'v:update-using Testing 'v:update Testing
passed passed
~~~ ~~~
@ -2215,13 +2225,6 @@ passed
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
~~~
'words Testing
passed
~~~
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
~~~ ~~~
'xor Testing 'xor Testing
passed passed