fix for broken int-op test case
authorStefan Behnel <scoder@users.berlios.de>
Wed, 9 Apr 2008 16:03:09 +0000 (18:03 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 9 Apr 2008 16:03:09 +0000 (18:03 +0200)
tests/run/cintop.pyx

index 49d36ee67dcd92c27d71e64a61903e84ad557e88..4001346934b9eea4c2f31d5f73fdc5eb34f5c7cd 100644 (file)
@@ -1,6 +1,20 @@
 __doc__ = """
+    >>> int2 = 42
+    >>> int3 = 7
+    >>> char1 = ord('C')
+
+    >>> int1 = int2 | int3
+    >>> int1 |= int2 ^ int3
+    >>> int1 ^= int2 & int3
+    >>> int1 ^= int2 << int3
+    >>> int1 ^= int2 >> int3
+    >>> int1 ^= int2 << int3 | int2 >> int3
+    >>> long1 = char1 | int1
+    >>> print (int1, long1) == f()
+    True
+
     >>> f()
-    (5376, 67)
+    (45, 111)
 """
 
 def f():
@@ -12,10 +26,10 @@ def f():
     char1 = c'C'
 
     int1 = int2 | int3
-    int1 = int2 ^ int3
-    int1 = int2 & int3
-    int1 = int2 << int3
-    int1 = int2 >> int3
-    int1 = int2 << int3 | int2 >> int3
-    long1 = char1 | long2
+    int1 |= int2 ^ int3
+    int1 ^= int2 & int3
+    int1 ^= int2 << int3
+    int1 ^= int2 >> int3
+    int1 ^= int2 << int3 | int2 >> int3
+    long1 = char1 | int1
     return int1, long1