[pypy-commit] pypy py3k: we no longer have longs; tweak the test to check that range() works well with large integers
antocuni
noreply at buildbot.pypy.org
Fri Feb 24 20:13:44 CET 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52886:cd36cd993475
Date: 2012-02-24 20:10 +0100
http://bitbucket.org/pypy/pypy/changeset/cd36cd993475/
Log: we no longer have longs; tweak the test to check that range() works
well with large integers
diff --git a/pypy/module/__builtin__/test/test_functional.py b/pypy/module/__builtin__/test/test_functional.py
--- a/pypy/module/__builtin__/test/test_functional.py
+++ b/pypy/module/__builtin__/test/test_functional.py
@@ -147,10 +147,10 @@
def test_range_long(self):
import sys
- a = long(10 * sys.maxint)
- raises(OverflowError, range, a)
- raises(OverflowError, range, 0, a)
- raises(OverflowError, range, 0, 1, a)
+ a = 10 * sys.maxsize
+ assert range(a)[-1] == a-1
+ assert range(0, a)[-1] == a-1
+ assert range(0, 1, a)[-1] == 0
def test_range_reduce(self):
x = range(2, 9, 3)
More information about the pypy-commit
mailing list