]> granicus.if.org Git - python/commitdiff
Fix the superficial augmented-assignment tests to deal with true division.
authorThomas Wouters <thomas@python.org>
Sat, 15 Apr 2006 09:10:43 +0000 (09:10 +0000)
committerThomas Wouters <thomas@python.org>
Sat, 15 Apr 2006 09:10:43 +0000 (09:10 +0000)
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

Lib/test/output/test_augassign
Lib/test/test_augassign.py

index af840f8dcd00fe5c1c844d2d088d34ffe6181f4e..b66b7e5e4e46ac7b363eecfb8aa8b3748a88f0f4 100644 (file)
@@ -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 @@ __isub__ called
 __mul__ called
 __rmul__ called
 __imul__ called
-__div__ called
-__rdiv__ called
-__idiv__ called
+__truediv__ called
+__rtruediv__ called
+__itruediv__ called
 __floordiv__ called
 __rfloordiv__ called
 __ifloordiv__ called
index 228e03a3100b572287cade390741f138401af207..22cca44e99a7176f2cd5ff3e3096607d78634c15 100644 (file)
@@ -5,42 +5,51 @@ x += 1
 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]