mirror of https://github.com/python/cpython
Change new tests to use integer division (// instead of /).
This commit is contained in:
parent
a3c01ce696
commit
6d30c3e391
|
@ -74,7 +74,7 @@ if not (xsize*ysize*zsize == zsize*xsize*ysize == 338912):
|
|||
# And another.
|
||||
m = -sys.maxint - 1
|
||||
for divisor in 1, 2, 4, 8, 16, 32:
|
||||
j = m / divisor
|
||||
j = m // divisor
|
||||
prod = divisor * j
|
||||
if prod != m:
|
||||
raise TestFailed, "%r * %r == %r != %r" % (divisor, j, prod, m)
|
||||
|
@ -83,7 +83,7 @@ for divisor in 1, 2, 4, 8, 16, 32:
|
|||
type(prod))
|
||||
# Check for expected * overflow to long.
|
||||
for divisor in 1, 2, 4, 8, 16, 32:
|
||||
j = m / divisor - 1
|
||||
j = m // divisor - 1
|
||||
prod = divisor * j
|
||||
if type(prod) is not long:
|
||||
raise TestFailed, ("expected type(%r) to be long, not %r" %
|
||||
|
@ -91,7 +91,7 @@ for divisor in 1, 2, 4, 8, 16, 32:
|
|||
# Check for expected * overflow to long.
|
||||
m = sys.maxint
|
||||
for divisor in 1, 2, 4, 8, 16, 32:
|
||||
j = m / divisor + 1
|
||||
j = m // divisor + 1
|
||||
prod = divisor * j
|
||||
if type(prod) is not long:
|
||||
raise TestFailed, ("expected type(%r) to be long, not %r" %
|
||||
|
|
Loading…
Reference in New Issue