summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tuple.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-09-30 07:47:20 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-09-30 07:47:20 (GMT)
commit5ea7e31076ad80af028d6cb0fa5d4e17f2b467fa (patch)
tree5a307e19aaad9cebe2aa63d94194fd3052581926 /Lib/test/test_tuple.py
parentf751fa61950c08424c369d32c42c978c492154bc (diff)
downloadcpython-5ea7e31076ad80af028d6cb0fa5d4e17f2b467fa.zip
cpython-5ea7e31076ad80af028d6cb0fa5d4e17f2b467fa.tar.gz
cpython-5ea7e31076ad80af028d6cb0fa5d4e17f2b467fa.tar.bz2
Improve test coverage.
Diffstat (limited to 'Lib/test/test_tuple.py')
-rw-r--r--Lib/test/test_tuple.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py
index 33a6edd..dddb03e 100644
--- a/Lib/test/test_tuple.py
+++ b/Lib/test/test_tuple.py
@@ -65,6 +65,17 @@ class TupleTest(seq_tests.CommonTest):
collisions = len(inps) - len(set(map(hash, inps)))
self.assert_(collisions <= 15)
+ def test_repr(self):
+ l0 = tuple()
+ l2 = (0, 1, 2)
+ a0 = self.type2test(l0)
+ a2 = self.type2test(l2)
+
+ self.assertEqual(str(a0), repr(l0))
+ self.assertEqual(str(a2), repr(l2))
+ self.assertEqual(repr(a0), "()")
+ self.assertEqual(repr(a2), "(0, 1, 2)")
+
def test_main():
test_support.run_unittest(TupleTest)