From 72a59457b1e033d4983dec5a2155ccfe011109e1 Mon Sep 17 00:00:00 2001 From: Louis Rubet Date: Sat, 29 Apr 2017 16:46:46 +0200 Subject: [PATCH] Corrected tests --- test/entry.txt | 7 ++++++- test/stack.txt | 46 ++++++++++++---------------------------------- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/test/entry.txt b/test/entry.txt index 209cd0e..e4300c6 100644 --- a/test/entry.txt +++ b/test/entry.txt @@ -62,7 +62,7 @@ erase erase #1101b -> stack size should be 1 --> stack should be 13 d +-> stack should be 13 d # symbol erase @@ -75,6 +75,11 @@ erase -> stack size should be 1 -> stack should be 'test' +erase +'' +-> stack size should be 1 +-> stack should be '' + # string erase "test string" diff --git a/test/stack.txt b/test/stack.txt index c77a053..951f00c 100644 --- a/test/stack.txt +++ b/test/stack.txt @@ -1,56 +1,34 @@ ## STACK TEST -# test entry 1 +# entry depth 1 1 -> stack size should be 1 -# test entry 2 +# entry depth 2 2 3 -> stack size should be 3 --> stack should be 3, 2, 1 +-> stack should be 1, 2, 3 -# test drop +# drop drop -> stack size should be 2 -# test drop2 +# drop2 drop2 -> stack size should be 0 -# test drop error +# drop error drop -> error should be 2 -# test drop2 error +# drop2 error drop2 -> error should be 2 -# test drop2 error +# drop2 error 1 drop2 -> error should be 2 drop -# test symbol entry 1 -1 '2' --> stack size should be 2 --> stack should be '2', 1 -drop2 - -# test symbol entry 2 -1 '2 --> stack size should be 2 --> stack should be '2', 1 -drop2 - -# test symbol entry 3 -'' --> stack should be '' -drop - -# test symbol entry 4 -' --> stack should be '' -drop - # test dup 1 dup -> stack size should be 2 @@ -59,24 +37,24 @@ drop # test dup2 drop 2 dup2 -> stack size should be 4 --> stack should be 2, 1, 2, 1 +-> stack should be 1, 2, 1, 2 drop2 drop2 # test rot 1 2 3 rot -> stack size should be 3 --> stack should be 1, 3, 2 +-> stack should be 2, 3 ,1 # test depth depth -> stack size should be 4 --> stack should be 3, 1, 3, 2 +-> stack should be 3, 2, 3 ,1 drop2 drop2 # test pick 1 2 3 4 2 pick -> stack size should be 5 --> stack should be 3, 4, 3, 2, 1 +-> stack should be 2, 1, 2, 3, 4 # test erase erase