rpn/test/070-test.md

506 lines
3.6 KiB
Markdown
Raw Normal View History

2022-02-12 19:11:22 +01:00
# TESTS
`default del`
## and (1)
`and`
2014-09-05 15:45:11 +02:00
-> error should be 2
2022-02-12 19:11:22 +01:00
`1 and`
2014-09-05 15:45:11 +02:00
-> error should be 2
2022-02-12 19:11:22 +01:00
`del`
## and (2)
`0 0 and`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## and (3)
`1 0 and`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## and (4)
`0 1 and`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## and (5)
`1 1 and`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## or (1)
`or`
2014-09-05 15:45:11 +02:00
-> error should be 2
2022-02-12 19:11:22 +01:00
`1 or`
2014-09-05 15:45:11 +02:00
-> error should be 2
2022-02-12 19:11:22 +01:00
`del`
## or (2)
`0 0 or`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## or (3)
`0 1 or`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## or (4)
`1 0 or`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## or (5)
`1 1 or`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## xor (1)
`xor`
2014-09-05 15:45:11 +02:00
-> error should be 2
2022-02-12 19:11:22 +01:00
`1 xor`
2014-09-05 15:45:11 +02:00
-> error should be 2
2022-02-12 19:11:22 +01:00
`del`
## xor (2)
`0 0 xor`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## xor (3)
`0 1 xor`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## xor (4)
`1 0 xor`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## xor (5)
`1 1 xor`
2014-09-05 15:45:11 +02:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2014-09-05 15:45:11 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## not (1)
`not`
2017-05-13 12:46:42 +02:00
-> error should be 2
2022-02-12 19:11:22 +01:00
`1 not`
2014-01-03 23:45:07 +01:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2017-05-13 12:46:42 +02:00
-> stack should be 0
2014-01-03 23:45:07 +01:00
2022-02-12 19:11:22 +01:00
`del`
## not (2)
`0 not`
2014-01-03 23:45:07 +01:00
-> stack size should be 1
2022-02-12 19:11:22 +01:00
2017-05-13 12:46:42 +02:00
-> stack should be 1
2014-01-03 23:45:07 +01:00
2022-02-12 19:11:22 +01:00
`del`
## >
`0 0.1 >`
2014-01-03 23:45:07 +01:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`0.1 0 >`
2017-05-13 12:46:42 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`1 1 >`
2014-01-03 23:45:07 +01:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## >=
`0 0.1 >=`
2017-05-13 12:46:42 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`0.1 0 >=`
2017-05-13 12:46:42 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`1 1 >=`
2017-05-13 12:46:42 +02:00
-> stack should be 1
2014-01-03 23:45:07 +01:00
2022-02-12 19:11:22 +01:00
`del`
## <
`0 0.1 <`
2014-01-03 23:45:07 +01:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`0.1 0 <`
2017-05-13 12:46:42 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`1 1 <`
2017-05-13 12:46:42 +02:00
-> stack should be 0
2014-01-03 23:45:07 +01:00
2022-02-12 19:11:22 +01:00
`del`
## <=
`0 0.1 <=`
2017-05-13 12:46:42 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`0.1 0 <=`
2017-05-13 12:46:42 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`1 1 <=`
2017-05-13 12:46:42 +02:00
-> stack should be 1
2014-01-03 23:45:07 +01:00
2022-02-12 19:11:22 +01:00
`del`
## !=
`0 0.1 !=`
2017-05-13 12:46:42 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`1 1 !=`
2017-05-13 12:46:42 +02:00
-> stack should be 0
2014-01-03 23:45:07 +01:00
2022-02-12 19:11:22 +01:00
`del`
## ==
`0 0.1 ==`
2017-05-13 12:46:42 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`1 1 ==`
2017-05-13 12:46:42 +02:00
-> stack should be 1
2014-01-03 23:45:07 +01:00
2022-02-12 19:11:22 +01:00
`del`
## same
`0 0.1 same`
2017-05-13 12:46:42 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`1 1 same`
2017-05-13 12:46:42 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## complex !=
`(1,2) (3,4) !=`
2017-06-21 23:17:29 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (1,0) !=`
2017-06-21 23:17:29 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (0,2) !=`
2017-06-21 23:17:29 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (1,2) !=`
2017-06-21 23:17:29 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## complex ==
`(1,2) (3,4) ==`
2017-06-21 23:17:29 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (1,0) ==`
2017-06-21 23:17:29 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (0,2) ==`
2017-06-21 23:17:29 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (1,2) ==`
2017-06-21 23:17:29 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## complex same
`(1,2) (3,4) same`
2017-06-21 23:17:29 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (1,0) same`
2017-06-21 23:17:29 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (0,2) same`
2017-06-21 23:17:29 +02:00
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`(1,2) (1,2) same`
2017-06-21 23:17:29 +02:00
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## string >
`"a" "b" >`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`"b" "a" >`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`"a" "a" >`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## string >=
`"a" "b" >=`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`"b" "a" >=`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`"a" "a" >=`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## string <
`"a" "b" <`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`"b" "a" <`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`"a" "a" <`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## string <=
`"a" "b" <=`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`"b" "a" <=`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`"a" "a" <=`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## string !=
`"a" "b" !=`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
`"a" "a" !=`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
## string ==
`"a" "b" ==`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`"a" "a" ==`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`
## string same
`"a" "b" same`
-> stack should be 0
2022-02-12 19:11:22 +01:00
`del`
`"a" "a" same`
-> stack should be 1
2022-02-12 19:11:22 +01:00
`del`