mirror of
https://github.com/louisrubet/rpn
synced 2024-12-28 09:58:52 +01:00
#3: completed some tests
This commit is contained in:
parent
9923cbe514
commit
600ec10e59
3 changed files with 11 additions and 23 deletions
|
@ -46,24 +46,6 @@ nan
|
||||||
@nan@
|
@nan@
|
||||||
-> stack should be inf, inf, inf, inf, -inf, -inf, nan, nan
|
-> stack should be inf, inf, inf, inf, -inf, -inf, nan, nan
|
||||||
|
|
||||||
# binary decimal
|
|
||||||
erase
|
|
||||||
#123d
|
|
||||||
-> stack size should be 1
|
|
||||||
-> stack should be 123 d
|
|
||||||
|
|
||||||
# binary hex
|
|
||||||
erase
|
|
||||||
#123h
|
|
||||||
-> stack size should be 1
|
|
||||||
-> stack should be 291 d
|
|
||||||
|
|
||||||
# binary binary
|
|
||||||
erase
|
|
||||||
#1101b
|
|
||||||
-> stack size should be 1
|
|
||||||
-> stack should be 13 d
|
|
||||||
|
|
||||||
# symbol
|
# symbol
|
||||||
erase
|
erase
|
||||||
'test'
|
'test'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## 2 ## TEST
|
## TESTS
|
||||||
# and (1)
|
# and (1)
|
||||||
and
|
and
|
||||||
-> error should be 2
|
-> error should be 2
|
||||||
|
|
|
@ -43,18 +43,24 @@ drop2 drop2
|
||||||
# test rot
|
# test rot
|
||||||
1 2 3 rot
|
1 2 3 rot
|
||||||
-> stack size should be 3
|
-> stack size should be 3
|
||||||
-> stack should be 2, 3 ,1
|
-> stack should be 2, 3, 1
|
||||||
|
erase
|
||||||
|
|
||||||
# test depth
|
# test depth
|
||||||
|
1 2 3
|
||||||
depth
|
depth
|
||||||
-> stack size should be 4
|
-> stack size should be 4
|
||||||
-> stack should be 3, 2, 3 ,1
|
-> stack should be 1, 2, 3, 3
|
||||||
drop2 drop2
|
erase
|
||||||
|
|
||||||
# test pick
|
# test pick
|
||||||
1 2 3 4 2 pick
|
1 2 3 4 2 pick
|
||||||
-> stack size should be 5
|
-> stack size should be 5
|
||||||
-> stack should be 2, 1, 2, 3, 4
|
-> stack should be 1, 2, 3, 4, 3
|
||||||
|
0 pick
|
||||||
|
-> error should be 4
|
||||||
|
7 pick
|
||||||
|
-> error should be 4
|
||||||
|
|
||||||
# test erase
|
# test erase
|
||||||
erase
|
erase
|
||||||
|
|
Loading…
Reference in a new issue