[Python-3000-checkins] r45425 - in python/branches/p3yk/Lib/test: output/test_augassign test_augassign.py

thomas.wouters python-3000-checkins at python.org
Sat Apr 15 11:10:44 CEST 2006


Author: thomas.wouters
Date: Sat Apr 15 11:10:43 2006
New Revision: 45425

Modified:
   python/branches/p3yk/Lib/test/output/test_augassign
   python/branches/p3yk/Lib/test/test_augassign.py
Log:

Fix the superficial augmented-assignment tests to deal with true division.
Add (equally superficial) >>=/<<= test in the process. Relies on floats that
should be extremely close to the int '6' printing as '6.0', but I believe
that's a valid assumption ;P



Modified: python/branches/p3yk/Lib/test/output/test_augassign
==============================================================================
--- python/branches/p3yk/Lib/test/output/test_augassign	(original)
+++ python/branches/p3yk/Lib/test/output/test_augassign	Sat Apr 15 11:10:43 2006
@@ -1,6 +1,9 @@
 test_augassign
+6.0
 6
-[6]
+[6.0]
+6
+6.0
 6
 [1, 2, 3, 4, 1, 2, 3, 4]
 [1, 2, 1, 2, 3]
@@ -22,9 +25,9 @@
 __mul__ called
 __rmul__ called
 __imul__ called
-__div__ called
-__rdiv__ called
-__idiv__ called
+__truediv__ called
+__rtruediv__ called
+__itruediv__ called
 __floordiv__ called
 __rfloordiv__ called
 __ifloordiv__ called

Modified: python/branches/p3yk/Lib/test/test_augassign.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_augassign.py	(original)
+++ python/branches/p3yk/Lib/test/test_augassign.py	Sat Apr 15 11:10:43 2006
@@ -5,42 +5,51 @@
 x *= 2
 x **= 2
 x -= 8
-x /= 2
-x //= 1
 x %= 12
+x >>= 1
 x &= 2
 x |= 5
 x ^= 1
+x <<= 2
+x /= 2
+x //= 2
 
 print x
+print int(x)
 
 x = [2]
 x[0] += 1
 x[0] *= 2
 x[0] **= 2
 x[0] -= 8
-x[0] /= 2
-x[0] //= 2
 x[0] %= 12
+x[0] >>= 1
 x[0] &= 2
 x[0] |= 5
 x[0] ^= 1
+x[0] <<= 2
+x[0] /= 2
+x[0] //= 2
 
 print x
+print int(x[0])
 
 x = {0: 2}
 x[0] += 1
 x[0] *= 2
 x[0] **= 2
 x[0] -= 8
-x[0] /= 2
-x[0] //= 1
 x[0] %= 12
+x[0] >>= 1
 x[0] &= 2
 x[0] |= 5
 x[0] ^= 1
+x[0] <<= 2
+x[0] /= 2
+x[0] //= 2
 
 print x[0]
+print int(x[0])
 
 x = [1,2]
 x += [3,4]


More information about the Python-3000-checkins mailing list