]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue 21100: Amazingly, tuple lexicographic ordering was untested.
authorRaymond Hettinger <python@rcn.com>
Sun, 30 Mar 2014 17:12:09 +0000 (10:12 -0700)
committerRaymond Hettinger <python@rcn.com>
Sun, 30 Mar 2014 17:12:09 +0000 (10:12 -0700)
Lib/test/test_tuple.py

index e41711c8e69e101af946f184f96b979872ebc9a1..14c64308694f8cd63e8c0b0706f63d4c482c8a58 100644 (file)
@@ -201,6 +201,14 @@ class TupleTest(seq_tests.CommonTest):
         with self.assertRaises(TypeError):
             [3,] + T((1,2))
 
+    def test_lexicographic_ordering(self):
+        # Issue 21100
+        a = self.type2test([1, 2])
+        b = self.type2test([1, 2, 0])
+        c = self.type2test([1, 3])
+        self.assertLess(a, b)
+        self.assertLess(b, c)
+
 def test_main():
     support.run_unittest(TupleTest)