diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-08-29 17:50:27 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-08-29 17:50:27 (GMT) |
commit | 4de8df92e93ef2dd08064f6b8ebea59738f189c5 (patch) | |
tree | 000a4bc43f44427efdf5922b8e990b6551638dc3 | |
parent | da8db8ca186ab8a811b44b90816b57b6f20caa61 (diff) | |
download | cpython-4de8df92e93ef2dd08064f6b8ebea59738f189c5.zip cpython-4de8df92e93ef2dd08064f6b8ebea59738f189c5.tar.gz cpython-4de8df92e93ef2dd08064f6b8ebea59738f189c5.tar.bz2 |
Add tests for augmented floor division
-rw-r--r-- | Lib/test/output/test_augassign | 3 | ||||
-rw-r--r-- | Lib/test/test_augassign.py | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/Lib/test/output/test_augassign b/Lib/test/output/test_augassign index ceffd59..2a461f6 100644 --- a/Lib/test/output/test_augassign +++ b/Lib/test/output/test_augassign @@ -25,6 +25,9 @@ __imul__ called __div__ called __rdiv__ called __idiv__ called +__floordiv__ called +__rfloordiv__ called +__ifloordiv__ called __mod__ called __rmod__ called __imod__ called diff --git a/Lib/test/test_augassign.py b/Lib/test/test_augassign.py index a37b4e1..e9e5b23 100644 --- a/Lib/test/test_augassign.py +++ b/Lib/test/test_augassign.py @@ -6,6 +6,7 @@ x *= 2 x **= 2 x -= 8 x /= 2 +x //= 1 x %= 12 x &= 2 x |= 5 @@ -19,6 +20,7 @@ x[0] *= 2 x[0] **= 2 x[0] -= 8 x[0] /= 2 +x[0] //= 2 x[0] %= 12 x[0] &= 2 x[0] |= 5 @@ -32,6 +34,7 @@ x[0] *= 2 x[0] **= 2 x[0] -= 8 x[0] /= 2 +x[0] //= 1 x[0] %= 12 x[0] &= 2 x[0] |= 5 @@ -128,6 +131,23 @@ class testall: print "__idiv__ called" return self + def __floordiv__(self, val): + print "__floordiv__ called" + return self + def __ifloordiv__(self, val): + print "__ifloordiv__ called" + return self + def __rfloordiv__(self, val): + print "__rfloordiv__ called" + return self + + def __truediv__(self, val): + print "__truediv__ called" + return self + def __itruediv__(self, val): + print "__itruediv__ called" + return self + def __mod__(self, val): print "__mod__ called" def __rmod__(self, val): @@ -201,6 +221,10 @@ x / 1 1 / x x /= 1 +x // 1 +1 // x +x //= 1 + x % 1 1 % x x %= 1 |