From: Guido van Rossum Date: Mon, 10 Apr 2000 17:41:37 +0000 (+0000) Subject: Christian Tismer: added test to ensure that multiplication commutes. X-Git-Tag: v1.6a2~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e277cf7deb76ec83e8fe67ee78e9d9cb7977814;p=thirdparty%2FPython%2Fcpython.git 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] --- diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 25abcc836584..6a1f1173325d 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)