summaryrefslogtreecommitdiff
path: root/tests/basics/int_big_error.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-10-01 18:49:37 +0100
committerDamien George <damien.p.george@gmail.com>2015-10-01 18:49:37 +0100
commita81539db25d443826e5247fefda8ae73bad64056 (patch)
treea4ff682df829cd98f1e46206d3bc3e08a560526b /tests/basics/int_big_error.py
parent2f4e8511cd602a6110b3636c316b5cac21181bf3 (diff)
tests: Add further tests for mpz code.
Diffstat (limited to 'tests/basics/int_big_error.py')
-rw-r--r--tests/basics/int_big_error.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/int_big_error.py b/tests/basics/int_big_error.py
index 62ab936f9..b7875ee87 100644
--- a/tests/basics/int_big_error.py
+++ b/tests/basics/int_big_error.py
@@ -16,3 +16,16 @@ try:
1 in i
except TypeError:
print("TypeError")
+
+# overflow because rhs of >> is being converted to machine int
+try:
+ 1 >> i
+except OverflowError:
+ print('OverflowError')
+
+# to test conversion of negative mpz to machine int
+# (we know << will convert to machine int, even though it fails to do the shift)
+try:
+ i << (-(i >> 40))
+except ValueError:
+ print('ValueError')