summaryrefslogtreecommitdiff
path: root/Lib/test/test_range.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-04-15 08:15:40 +0300
committerEzio Melotti <ezio.melotti@gmail.com>2011-04-15 08:15:40 +0300
commit982ef4e0bc2b1def1117238fb5292cca5dfa2891 (patch)
treea447bed2a4cb4b074e04cf3d77a8db7993219278 /Lib/test/test_range.py
parent34d204bc85074a96754e4cd1f23f1c148d0d9aaa (diff)
downloadcpython-git-982ef4e0bc2b1def1117238fb5292cca5dfa2891.tar.gz
#11845: Fix typo in rangeobject.c that caused a crash in compute_slice_indices. Patch by Daniel Urban.
Diffstat (limited to 'Lib/test/test_range.py')
-rw-r--r--Lib/test/test_range.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py
index fc310c1534..ede07912b0 100644
--- a/Lib/test/test_range.py
+++ b/Lib/test/test_range.py
@@ -498,6 +498,15 @@ class RangeTest(unittest.TestCase):
]:
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)