summaryrefslogtreecommitdiffstats
path: root/Lib/test/output/test_richcmp
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-01-18 15:48:05 (GMT)
committerGuido van Rossum <guido@python.org>2001-01-18 15:48:05 (GMT)
commitc4a6e8b65a9c55b41c4aee2c542e5dda5ae96e57 (patch)
treed8338764c6c4c4a62669d077db67961950e7a98a /Lib/test/output/test_richcmp
parentab782dd6ccd47ba3d2cf7e61abd3e95ec14ed84c (diff)
downloadcpython-c4a6e8b65a9c55b41c4aee2c542e5dda5ae96e57.zip
cpython-c4a6e8b65a9c55b41c4aee2c542e5dda5ae96e57.tar.gz
cpython-c4a6e8b65a9c55b41c4aee2c542e5dda5ae96e57.tar.bz2
Rich comparison tests
Diffstat (limited to 'Lib/test/output/test_richcmp')
-rw-r--r--Lib/test/output/test_richcmp187
1 files changed, 187 insertions, 0 deletions
diff --git a/Lib/test/output/test_richcmp b/Lib/test/output/test_richcmp
new file mode 100644
index 0000000..2a9c787
--- /dev/null
+++ b/Lib/test/output/test_richcmp
@@ -0,0 +1,187 @@
+test_richcmp
+
+operator: <
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+Number(0) | 0 | 1 | 1 |
+Number(1) | 0 | 0 | 1 |
+Number(2) | 0 | 0 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: <=
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+Number(0) | 1 | 1 | 1 |
+Number(1) | 0 | 1 | 1 |
+Number(2) | 0 | 0 | 1 |
+----------+-----------+-----------+-----------+-
+
+operator: ==
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+Number(0) | 1 | 0 | 0 |
+Number(1) | 0 | 1 | 0 |
+Number(2) | 0 | 0 | 1 |
+----------+-----------+-----------+-----------+-
+
+operator: !=
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+Number(0) | 0 | 1 | 1 |
+Number(1) | 1 | 0 | 1 |
+Number(2) | 1 | 1 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: >
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+Number(0) | 0 | 0 | 0 |
+Number(1) | 1 | 0 | 0 |
+Number(2) | 1 | 1 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: >=
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+Number(0) | 1 | 0 | 0 |
+Number(1) | 1 | 1 | 0 |
+Number(2) | 1 | 1 | 1 |
+----------+-----------+-----------+-----------+-
+
+**************************************************
+
+operator: <
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+ 0 | 0 | 1 | 1 |
+ 1 | 0 | 0 | 1 |
+ 2 | 0 | 0 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: <=
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+ 0 | 1 | 1 | 1 |
+ 1 | 0 | 1 | 1 |
+ 2 | 0 | 0 | 1 |
+----------+-----------+-----------+-----------+-
+
+operator: ==
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+ 0 | 1 | 0 | 0 |
+ 1 | 0 | 1 | 0 |
+ 2 | 0 | 0 | 1 |
+----------+-----------+-----------+-----------+-
+
+operator: !=
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+ 0 | 0 | 1 | 1 |
+ 1 | 1 | 0 | 1 |
+ 2 | 1 | 1 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: >
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+ 0 | 0 | 0 | 0 |
+ 1 | 1 | 0 | 0 |
+ 2 | 1 | 1 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: >=
+
+ | Number(0) | Number(1) | Number(2) |
+----------+-----------+-----------+-----------+-
+ 0 | 1 | 0 | 0 |
+ 1 | 1 | 1 | 0 |
+ 2 | 1 | 1 | 1 |
+----------+-----------+-----------+-----------+-
+
+**************************************************
+
+operator: <
+
+ | 0 | 1 | 2 |
+----------+-----------+-----------+-----------+-
+Number(0) | 0 | 1 | 1 |
+Number(1) | 0 | 0 | 1 |
+Number(2) | 0 | 0 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: <=
+
+ | 0 | 1 | 2 |
+----------+-----------+-----------+-----------+-
+Number(0) | 1 | 1 | 1 |
+Number(1) | 0 | 1 | 1 |
+Number(2) | 0 | 0 | 1 |
+----------+-----------+-----------+-----------+-
+
+operator: ==
+
+ | 0 | 1 | 2 |
+----------+-----------+-----------+-----------+-
+Number(0) | 1 | 0 | 0 |
+Number(1) | 0 | 1 | 0 |
+Number(2) | 0 | 0 | 1 |
+----------+-----------+-----------+-----------+-
+
+operator: !=
+
+ | 0 | 1 | 2 |
+----------+-----------+-----------+-----------+-
+Number(0) | 0 | 1 | 1 |
+Number(1) | 1 | 0 | 1 |
+Number(2) | 1 | 1 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: >
+
+ | 0 | 1 | 2 |
+----------+-----------+-----------+-----------+-
+Number(0) | 0 | 0 | 0 |
+Number(1) | 1 | 0 | 0 |
+Number(2) | 1 | 1 | 0 |
+----------+-----------+-----------+-----------+-
+
+operator: >=
+
+ | 0 | 1 | 2 |
+----------+-----------+-----------+-----------+-
+Number(0) | 1 | 0 | 0 |
+Number(1) | 1 | 1 | 0 |
+Number(2) | 1 | 1 | 1 |
+----------+-----------+-----------+-----------+-
+
+**************************************************
+Vector([0, 1, 2, 3, 4]) < Vector([2, 2, 2, 2, 2]) -> Vector([1, 1, 0, 0, 0])
+Vector([0, 1, 2, 3, 4]) < [2, 2, 2, 2, 2] -> Vector([1, 1, 0, 0, 0])
+ [0, 1, 2, 3, 4] < Vector([2, 2, 2, 2, 2]) -> Vector([1, 1, 0, 0, 0])
+Vector([0, 1, 2, 3, 4]) <= Vector([2, 2, 2, 2, 2]) -> Vector([1, 1, 1, 0, 0])
+Vector([0, 1, 2, 3, 4]) <= [2, 2, 2, 2, 2] -> Vector([1, 1, 1, 0, 0])
+ [0, 1, 2, 3, 4] <= Vector([2, 2, 2, 2, 2]) -> Vector([1, 1, 1, 0, 0])
+Vector([0, 1, 2, 3, 4]) == Vector([2, 2, 2, 2, 2]) -> Vector([0, 0, 1, 0, 0])
+Vector([0, 1, 2, 3, 4]) == [2, 2, 2, 2, 2] -> Vector([0, 0, 1, 0, 0])
+ [0, 1, 2, 3, 4] == Vector([2, 2, 2, 2, 2]) -> Vector([0, 0, 1, 0, 0])
+Vector([0, 1, 2, 3, 4]) != Vector([2, 2, 2, 2, 2]) -> Vector([1, 1, 0, 1, 1])
+Vector([0, 1, 2, 3, 4]) != [2, 2, 2, 2, 2] -> Vector([1, 1, 0, 1, 1])
+ [0, 1, 2, 3, 4] != Vector([2, 2, 2, 2, 2]) -> Vector([1, 1, 0, 1, 1])
+Vector([0, 1, 2, 3, 4]) > Vector([2, 2, 2, 2, 2]) -> Vector([0, 0, 0, 1, 1])
+Vector([0, 1, 2, 3, 4]) > [2, 2, 2, 2, 2] -> Vector([0, 0, 0, 1, 1])
+ [0, 1, 2, 3, 4] > Vector([2, 2, 2, 2, 2]) -> Vector([0, 0, 0, 1, 1])
+Vector([0, 1, 2, 3, 4]) >= Vector([2, 2, 2, 2, 2]) -> Vector([0, 0, 1, 1, 1])
+Vector([0, 1, 2, 3, 4]) >= [2, 2, 2, 2, 2] -> Vector([0, 0, 1, 1, 1])
+ [0, 1, 2, 3, 4] >= Vector([2, 2, 2, 2, 2]) -> Vector([0, 0, 1, 1, 1])