mirror of
https://github.com/louisrubet/rpn
synced 2024-12-28 09:58:52 +01:00
#3: completed binary tests
This commit is contained in:
parent
6092d15e77
commit
ac692e2f47
1 changed files with 82 additions and 0 deletions
|
@ -91,3 +91,85 @@ drop
|
|||
-> stack size should be 1
|
||||
-> stack should be 0
|
||||
drop
|
||||
|
||||
# not (1)
|
||||
not
|
||||
-> error should be 2
|
||||
1 not
|
||||
-> stack size should be 1
|
||||
-> stack should be 0
|
||||
drop
|
||||
|
||||
# not (2)
|
||||
0 not
|
||||
-> stack size should be 1
|
||||
-> stack should be 1
|
||||
drop
|
||||
|
||||
# >
|
||||
0 0.1 >
|
||||
-> stack should be 0
|
||||
drop
|
||||
0.1 0 >
|
||||
-> stack should be 1
|
||||
drop
|
||||
1 1 >
|
||||
-> stack should be 0
|
||||
drop
|
||||
|
||||
# >=
|
||||
0 0.1 >=
|
||||
-> stack should be 0
|
||||
drop
|
||||
0.1 0 >=
|
||||
-> stack should be 1
|
||||
drop
|
||||
1 1 >=
|
||||
-> stack should be 1
|
||||
drop
|
||||
|
||||
# <
|
||||
0 0.1 <
|
||||
-> stack should be 1
|
||||
drop
|
||||
0.1 0 <
|
||||
-> stack should be 0
|
||||
drop
|
||||
1 1 <
|
||||
-> stack should be 0
|
||||
drop
|
||||
|
||||
# <=
|
||||
0 0.1 <=
|
||||
-> stack should be 1
|
||||
drop
|
||||
0.1 0 <=
|
||||
-> stack should be 0
|
||||
drop
|
||||
1 1 <=
|
||||
-> stack should be 1
|
||||
drop
|
||||
|
||||
# !=
|
||||
0 0.1 !=
|
||||
-> stack should be 1
|
||||
drop
|
||||
1 1 !=
|
||||
-> stack should be 0
|
||||
drop
|
||||
|
||||
# ==
|
||||
0 0.1 ==
|
||||
-> stack should be 0
|
||||
drop
|
||||
1 1 ==
|
||||
-> stack should be 1
|
||||
drop
|
||||
|
||||
# same
|
||||
0 0.1 same
|
||||
-> stack should be 0
|
||||
drop
|
||||
1 1 same
|
||||
-> stack should be 1
|
||||
drop
|
||||
|
|
Loading…
Reference in a new issue