rpn/test/stack.txt

62 lines
800 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-04-29 16:46:46 +02:00
-> stack should be 2, 3 ,1
2017-04-23 15:50:19 +02:00
# test depth
depth
-> stack size should be 4
2017-04-29 16:46:46 +02:00
-> stack should be 3, 2, 3 ,1
2017-04-23 15:50:19 +02:00
drop2 drop2
# test pick
1 2 3 4 2 pick
-> stack size should be 5
2017-04-29 16:46:46 +02:00
-> stack should be 2, 1, 2, 3, 4
2017-04-23 15:50:19 +02:00
# test erase
erase
-> stack size should be 0