summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-05-20 08:22:37 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-05-20 08:22:37 (GMT)
commit67d999305f221dc8c7db7bf8395fcd3aae786f4d (patch)
tree78720817a1a7abc7a9f1222a768a564cb92cd78e
parent850e516ebc29187a200fecd7e325ea000f42043f (diff)
downloadcpython-67d999305f221dc8c7db7bf8395fcd3aae786f4d.zip
cpython-67d999305f221dc8c7db7bf8395fcd3aae786f4d.tar.gz
cpython-67d999305f221dc8c7db7bf8395fcd3aae786f4d.tar.bz2
Add a few simple repr tests.
-rw-r--r--Lib/test/test_xrange.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_xrange.py b/Lib/test/test_xrange.py
index 1e7f9de..a31f175 100644
--- a/Lib/test/test_xrange.py
+++ b/Lib/test/test_xrange.py
@@ -56,6 +56,11 @@ class XrangeTest(unittest.TestCase):
r = range(-sys.maxint, sys.maxint, 2)
self.assertEqual(len(r), sys.maxint)
+ def test_repr(self):
+ self.assertEqual(repr(range(1)), 'range(1)')
+ self.assertEqual(repr(range(1, 2)), 'range(1, 2)')
+ self.assertEqual(repr(range(1, 2, 3)), 'range(1, 2, 3)')
+
def test_main():
test.test_support.run_unittest(XrangeTest)