Change new tests to use integer division (// instead of /).

This commit is contained in:
Tim Peters 2001-12-05 00:30:09 +00:00
parent a3c01ce696
commit 6d30c3e391
1 changed files with 3 additions and 3 deletions

View File

@ -74,7 +74,7 @@ if not (xsize*ysize*zsize == zsize*xsize*ysize == 338912):
# And another. # And another.
m = -sys.maxint - 1 m = -sys.maxint - 1
for divisor in 1, 2, 4, 8, 16, 32: for divisor in 1, 2, 4, 8, 16, 32:
j = m / divisor j = m // divisor
prod = divisor * j prod = divisor * j
if prod != m: if prod != m:
raise TestFailed, "%r * %r == %r != %r" % (divisor, j, 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)) type(prod))
# Check for expected * overflow to long. # Check for expected * overflow to long.
for divisor in 1, 2, 4, 8, 16, 32: for divisor in 1, 2, 4, 8, 16, 32:
j = m / divisor - 1 j = m // divisor - 1
prod = divisor * j prod = divisor * j
if type(prod) is not long: if type(prod) is not long:
raise TestFailed, ("expected type(%r) to be long, not %r" % 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. # Check for expected * overflow to long.
m = sys.maxint m = sys.maxint
for divisor in 1, 2, 4, 8, 16, 32: for divisor in 1, 2, 4, 8, 16, 32:
j = m / divisor + 1 j = m // divisor + 1
prod = divisor * j prod = divisor * j
if type(prod) is not long: if type(prod) is not long:
raise TestFailed, ("expected type(%r) to be long, not %r" % raise TestFailed, ("expected type(%r) to be long, not %r" %