summaryrefslogtreecommitdiff
path: root/tests/basics/array_overflow.py
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-05-12 11:17:29 -0400
committerDan Halbert <halbert@halwitz.org>2019-05-12 11:17:29 -0400
commit8664a6574b4cb448df26bfaa0e12eb203cc5d759 (patch)
tree3fbbb02abd779ccb7e34f53b0b20d37a25b3e27c /tests/basics/array_overflow.py
parentd103ac1d6325a075be3fafe812858584435f3144 (diff)
use approx of original @godlygeek code for smallints; add tests
Diffstat (limited to 'tests/basics/array_overflow.py')
-rw-r--r--tests/basics/array_overflow.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/tests/basics/array_overflow.py b/tests/basics/array_overflow.py
deleted file mode 100644
index ba3eb7f06..000000000
--- a/tests/basics/array_overflow.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import skip_if
-skip_if.no_bigint()
-
-try:
- from array import array
-except ImportError:
- print("SKIP")
- raise SystemExit
-
-def test_array_overflow(typecode, val):
- try:
- print(array(typecode, [val]))
- except OverflowError:
- print('OverflowError')
-
-# small int -1
-test_array_overflow('Q', -1)
-test_array_overflow('L', -1)
-test_array_overflow('I', -1)
-test_array_overflow('H', -1)
-test_array_overflow('B', -1)
-
-# big int -1
-test_array_overflow('Q', -2**64 // 2**64)
-test_array_overflow('L', -2**64 // 2**64)
-test_array_overflow('I', -2**64 // 2**64)
-test_array_overflow('H', -2**64 // 2**64)
-test_array_overflow('B', -2**64 // 2**64)
-
-# big int 2**63
-test_array_overflow('q', 2**63)
-test_array_overflow('l', 2**63)
-test_array_overflow('i', 2**63)
-test_array_overflow('h', 2**63)
-test_array_overflow('b', 2**63)