rpn/test/05-stack.txt

68 lines
862 B
Text
Raw Normal View History

2017-04-23 15:50:19 +02:00
## STACK TEST
2017-04-29 16:46:46 +02:00
# entry depth 1
2017-04-23 15:50:19 +02:00
1
-> stack size should be 1
2017-04-29 16:46:46 +02:00
# entry depth 2
2017-04-23 15:50:19 +02:00
2 3
-> stack size should be 3
2017-04-29 16:46:46 +02:00
-> stack should be 1, 2, 3
2017-04-23 15:50:19 +02:00
2017-04-29 16:46:46 +02:00
# drop
2017-04-23 15:50:19 +02:00
drop
-> stack size should be 2
2017-04-29 16:46:46 +02:00
# drop2
2017-04-23 15:50:19 +02:00
drop2
-> stack size should be 0
2017-04-29 16:46:46 +02:00
# drop error
2017-04-23 15:50:19 +02:00
drop
-> error should be 2
2017-04-29 16:46:46 +02:00
# drop2 error
2017-04-23 15:50:19 +02:00
drop2
-> error should be 2
2017-04-29 16:46:46 +02:00
# drop2 error
2017-04-23 15:50:19 +02:00
1 drop2
-> error should be 2
drop
# test dup
1 dup
-> stack size should be 2
-> stack should be 1, 1
# test dup2
drop 2 dup2
-> stack size should be 4
2017-04-29 16:46:46 +02:00
-> stack should be 1, 2, 1, 2
2017-04-23 15:50:19 +02:00
drop2 drop2
# test rot
1 2 3 rot
-> stack size should be 3
2017-05-02 17:06:08 +02:00
-> stack should be 2, 3, 1
erase
2017-04-23 15:50:19 +02:00
# test depth
2017-05-02 17:06:08 +02:00
1 2 3
2017-04-23 15:50:19 +02:00
depth
-> stack size should be 4
2017-05-02 17:06:08 +02:00
-> stack should be 1, 2, 3, 3
erase
2017-04-23 15:50:19 +02:00
# test pick
1 2 3 4 2 pick
-> stack size should be 5
2017-05-02 17:06:08 +02:00
-> stack should be 1, 2, 3, 4, 3
0 pick
-> error should be 4
7 pick
-> error should be 4
2017-04-23 15:50:19 +02:00
# test erase
erase
-> stack size should be 0