diff Lib/test/test_range.py @ 69359:8025fb83dece 3.2

#11845: Fix typo in rangeobject.c that caused a crash in compute_slice_indices. Patch by Daniel Urban.
author Ezio Melotti <ezio.melotti@gmail.com>
date Fri, 15 Apr 2011 08:15:40 +0300
parents 3c9232a684ae
children 94d15358ad6e 479a7dd1ea6a
line wrap: on
line diff
--- a/Lib/test/test_range.py	Fri Apr 15 07:39:08 2011 +0300
+++ b/Lib/test/test_range.py	Fri Apr 15 08:15:40 2011 +0300
@@ -498,6 +498,15 @@
                   ]:
             self.assertEqual(list(reversed(r)), list(r)[::-1])
 
+    def test_issue11845(self):
+        r = range(*slice(1, 18, 2).indices(20))
+        values = {None, 0, 1, -1, 2, -2, 5, -5, 19, -19,
+                  20, -20, 21, -21, 30, -30, 99, -99}
+        for i in values:
+            for j in values:
+                for k in values - {0}:
+                    r[i:j:k]
+
 
 def test_main():
     test.support.run_unittest(RangeTest)