summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_long.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-04-10 17:41:37 (GMT)
committerGuido van Rossum <guido@python.org>2000-04-10 17:41:37 (GMT)
commit6e277cf7deb76ec83e8fe67ee78e9d9cb7977814 (patch)
tree71690f1352edcbd362a895ba79dbe9d60b1cf608 /Lib/test/test_long.py
parentba71a247acc7cac07a75d79ff087b29b56ee0b55 (diff)
downloadcpython-6e277cf7deb76ec83e8fe67ee78e9d9cb7977814.zip
cpython-6e277cf7deb76ec83e8fe67ee78e9d9cb7977814.tar.gz
cpython-6e277cf7deb76ec83e8fe67ee78e9d9cb7977814.tar.bz2
Christian Tismer: added test to ensure that multiplication commutes.
[The test is in a slightly odd place, in test_division_2; but it exercises the recent change to long_mult(), and that's all we really ask for. --GvR]
Diffstat (limited to 'Lib/test/test_long.py')
-rw-r--r--Lib/test/test_long.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 25abcc8..6a1f117 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -77,6 +77,8 @@ def getran2(ndigits):
def test_division_2(x, y):
q, r = divmod(x, y)
q2, r2 = x/y, x%y
+ pab, pba = x*y, y*x
+ check(pab == pba, "multiplication does not commute for", x, y)
check(q == q2, "divmod returns different quotient than / for", x, y)
check(r == r2, "divmod returns different mod than % for", x, y)
check(x == q*y + r, "x != q*y + r after divmod on", x, y)