diff --git a/test/test-custom.4th b/test/test-custom.4th index 51ea847..f7bc123 100644 --- a/test/test-custom.4th +++ b/test/test-custom.4th @@ -2,8 +2,8 @@ s" custom messages" describe#{ - :noname ." Just passed" cr ; ^passed. ! - :noname ." Just failed" cr ; ^different. ! + :noname ." Just passed" ; ^passed. ! + :noname ." Just failed" ; ^different. ! s" short strings" it#{ <{ s" Hello World!" s# -> s" Hello World!" s# }> @@ -17,8 +17,8 @@ s" custom messages" describe#{ 2variable actual$ 2variable expected$ - :noname ." Got '" actual$ 2@ type ." ' as expected" cr ; ^passed. ! - :noname ." Expected '" expected$ 2@ type ." ', got '" actual$ 2@ type ." '" cr ; ^different. ! + :noname ." Got '" actual$ 2@ type ." ' as expected" ; ^passed. ! + :noname ." Expected '" expected$ 2@ type ." ', got '" actual$ 2@ type ." '" ; ^different. ! : &actual 2dup actual$ 2! ; : &expected 2dup expected$ 2! ; diff --git a/test/test-mixed.expected b/test/test-mixed.expected index 829b617..13232cc 100644 --- a/test/test-mixed.expected +++ b/test/test-mixed.expected @@ -9,45 +9,40 @@ Test Passed -Wrong number of cell results, expected 1 , got 2 +Wrong number of cell results, expected 1 , got 2 Wrong number of float results, expected 1 , got 2 -Wrong number of cell results, expected 2 , got 3 +Wrong number of cell results, expected 2 , got 3 Wrong number of float results, expected 1 , got 2 -Wrong number of cell results, expected 2 , got 3 +Wrong number of cell results, expected 2 , got 3 Wrong number of float results, expected 1 , got 2 -Wrong number of cell results, expected 3 , got 4 +Wrong number of cell results, expected 3 , got 4 Wrong number of float results, expected 3 , got 4 -Wrong number of cell results, expected 3 , got 4 +Wrong number of cell results, expected 3 , got 4 Wrong number of float results, expected 3 , got 4 -Wrong number of cell results, expected 1 , got 2 -<:LF:>Wrong number of float results, expected 1 , got 2 +Wrong number of cell results, expected 1 , got 2 <:LF:>Wrong number of float results, expected 1 , got 2 -Wrong number of cell results, expected 1 , got 2 -<:LF:>Wrong number of float results, expected 1 , got 2 +Wrong number of cell results, expected 1 , got 2 <:LF:>Wrong number of float results, expected 1 , got 2 -Wrong number of cell results, expected 1 , got 2 -<:LF:>Wrong number of float results, expected 1 , got 2 +Wrong number of cell results, expected 1 , got 2 <:LF:>Wrong number of float results, expected 1 , got 2 Expected 2 , got 1 Expected 1. , got 2. -Expected 2 , got 1 -<:LF:>Expected 1. , got 2. +Expected 2 , got 1 <:LF:>Expected 1. , got 2. Expected 4 5 6 , got 1 2 3 Expected 1. 2. 3. , got 4. 5. 6. -Expected 4 5 6 , got 1 2 3 -<:LF:>Expected 1. 2. 3. , got 4. 5. 6. +Expected 4 5 6 , got 1 2 3 <:LF:>Expected 1. 2. 3. , got 4. 5. 6. diff --git a/test/test-overflow-storage.expected b/test/test-overflow-storage.expected index 41a1f58..5309222 100644 --- a/test/test-overflow-storage.expected +++ b/test/test-overflow-storage.expected @@ -1,27 +1,24 @@ Test Passed -Too many cell results to test +Too many cell results to test Too many float results to test -Too many cell results to test -<:LF:>Too many float results to test +Too many cell results to test<:LF:>Too many float results to test -Too many cell results to test +Too many cell results to test Too many float results to test -Too many cell results to test -<:LF:>Too many float results to test +Too many cell results to test<:LF:>Too many float results to test -Too many cell results to test +Too many cell results to test Too many float results to test -Too many expected cell results to test +Too many expected cell results to test Too many expected float results to test -Too many expected cell results to test -<:LF:>Too many expected float results to test +Too many expected cell results to test<:LF:>Too many expected float results to test diff --git a/test/test-stack-mismatch.expected b/test/test-stack-mismatch.expected index d7ee82a..4c20758 100644 --- a/test/test-stack-mismatch.expected +++ b/test/test-stack-mismatch.expected @@ -3,24 +3,24 @@ single test -Wrong number of cell results, expected 1 , got 2 +Wrong number of cell results, expected 1 , got 2 -0.023 ms +0.015 ms double test -Wrong number of cell results, expected 1 , got 2 +Wrong number of cell results, expected 1 , got 2 Test Passed -0.016 ms +0.013 ms double fail test -Wrong number of cell results, expected 1 , got 2 +Wrong number of cell results, expected 1 , got 2 -Wrong number of cell results, expected 3 , got 1 +Wrong number of cell results, expected 3 , got 1 -0.018 ms +0.014 ms -0.078 ms +0.058 ms diff --git a/test/test-stack-underflow.expected b/test/test-stack-underflow.expected index 21093dc..6909dd3 100644 --- a/test/test-stack-underflow.expected +++ b/test/test-stack-underflow.expected @@ -9,9 +9,9 @@ float stack unbalanced Test Passed -0.010 ms +0.012 ms -0.016 ms +0.018 ms cell stack balanced float stack balanced @@ -19,7 +19,7 @@ float stack balanced single test -Wrong number of cell results, expected 1 , got a 1 cell stack underflow +Wrong number of cell results, expected 1 , got a 1 cell stack underflow 0.008 ms @@ -31,39 +31,39 @@ float stack balanced single test -Wrong number of cell results, expected 1 , got a 1 cell stack underflow +Wrong number of cell results, expected 1 , got a 1 cell stack underflow 0.008 ms double test -Wrong number of cell results, expected 1 , got a 1 cell stack underflow +Wrong number of cell results, expected 1 , got a 1 cell stack underflow -Wrong number of cell results, expected 1 , got a 2 cell stack underflow +Wrong number of cell results, expected 1 , got a 2 cell stack underflow -1698095971439.486 ms +1698623934121.134 ms double test -Wrong number of cell results, expected 2 , got a 1 cell stack underflow +Wrong number of cell results, expected 2 , got a 1 cell stack underflow -Wrong number of cell results, expected 2 , got a 2 cell stack underflow +Wrong number of cell results, expected 2 , got a 2 cell stack underflow -1698095971439.504 ms +1698623934121.154 ms double test -Wrong number of cell results, expected 2 , got a 1 cell stack underflow +Wrong number of cell results, expected 2 , got a 1 cell stack underflow -Wrong number of cell results, expected 1 , got a 2 cell stack underflow +Wrong number of cell results, expected 1 , got a 2 cell stack underflow -1698095971439.522 ms +1698623934121.172 ms float test Wrong number of float results, expected 1 , got a 1 float stack underflow -0.008 ms +0.009 ms double float test @@ -71,7 +71,7 @@ float stack balanced Wrong number of float results, expected 1 , got a 2 float stack underflow -0.022 ms +0.014 ms double float test @@ -79,7 +79,7 @@ float stack balanced Wrong number of float results, expected 2 , got a 2 float stack underflow -0.015 ms +0.016 ms double float test @@ -89,6 +89,6 @@ float stack balanced 0.015 ms -0.142 ms +0.138 ms cell stack balanced float stack balanced diff --git a/test/test-too-little-arguments.expected b/test/test-too-little-arguments.expected index 23f8109..5e6d0bc 100644 --- a/test/test-too-little-arguments.expected +++ b/test/test-too-little-arguments.expected @@ -1,2 +1,2 @@ -Wrong number of cell results, expected 2 , got 1 +Wrong number of cell results, expected 2 , got 1 diff --git a/test/test-too-many-arguments.expected b/test/test-too-many-arguments.expected index eb4c52a..8631059 100644 --- a/test/test-too-many-arguments.expected +++ b/test/test-too-many-arguments.expected @@ -1,2 +1,2 @@ -Wrong number of cell results, expected 1 , got 2 +Wrong number of cell results, expected 1 , got 2 diff --git a/testest.4th b/testest.4th index 3e29c89..fc5965f 100644 --- a/testest.4th +++ b/testest.4th @@ -63,18 +63,18 @@ F<>: f<> \ default reporting -: passed. ." Test Passed" cr ; -: (different.) { e[] a[] '@ '. } e[] []> a[] [0] { n s c e* a* } n if ?lf# ." Expected " e[] '@ '. []. ." , got " a[] '@ '. []. cr lf ++ then ; +: passed. ." Test Passed" ; +: (different.) { e[] a[] '@ '. } e[] []> a[] [0] { n s c e* a* } n if ?lf# ." Expected " e[] '@ '. []. ." , got " a[] '@ '. []. lf ++ then ; : different. expecteds[] actuals[] ['] @ ['] . (different.) ; : fdifferent. expecteds.f[] actuals.f[] ['] f@ ['] f. (different.) ; : (#results.) { e[] a[] s* s# } e[] []> a[] []> { #e es ec e* #a as ac a* } - #a ac > if ?lf# ." Too many " s* s# type ." results to test" cr lf ++ exit then - #e ec > if ?lf# ." Too many expected " s* s# type ." results to test" cr lf ++ exit then + #a ac > if ?lf# ." Too many " s* s# type ." results to test" lf ++ exit then + #e ec > if ?lf# ." Too many expected " s* s# type ." results to test" lf ++ exit then #e #a - dup if ?lf# ." Wrong number of " s* s# type ." results, expected " #e . - ." , got " #a dup 0< if negate ." a " . s* s# type ." stack underflow" else . then cr lf ++ + ." , got " #a dup 0< if negate ." a " . s* s# type ." stack underflow" else . then lf ++ else drop then ; -: #results. expecteds[] actuals[] s" cell" (#results.) ; +: #results. expecteds[] actuals[] s" cell " (#results.) ; : #fresults. expecteds.f[] actuals.f[] s" float" (#results.) ; \ custom reporting @@ -96,8 +96,8 @@ variable ^#fresults. ' #fresults. ^#fresults. ! #results expecteds[] tuck ! #fresults expecteds.f[] tuck ! store-stacks reset-stacks 0 0 0 expecteds[] actuals[] ['] compare-result compare-results { #p #f #r } \ compare cells #p 0 0 expecteds.f[] actuals.f[] ['] fcompare-result compare-results { #pt #ff #rf } \ compare floats - #r #rf + #f #ff + + if failed# #r ^#results. ?@^ #rf ^#fresults. ?@^ #f ^different. ?@^ #ff ^fdifferent. ?@^ - else #pt 2 = if passed# ^passed. @ ^ then then reset-stacks ; + #r #rf + #f #ff + + if failed# #r ^#results. ?@^ #rf ^#fresults. ?@^ #f ^different. ?@^ #ff ^fdifferent. ?@^ cr + else #pt 2 = if passed# ^passed. @ ^ cr then then reset-stacks ; \ testest utility words