diff options
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r-- | Lib/test/test_struct.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index 917f626..616e665 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -8,6 +8,7 @@ from test.support import TestFailed, verbose, run_unittest, catch_warning import sys ISBIGENDIAN = sys.byteorder == "big" +IS32BIT = sys.maxsize == 0x7fffffff del sys try: @@ -580,6 +581,11 @@ class StructTest(unittest.TestCase): for c in [b'\x01', b'\x7f', b'\xff', b'\x0f', b'\xf0']: self.assertTrue(struct.unpack('>?', c)[0]) + if IS32BIT: + def test_crasher(self): + self.assertRaises(MemoryError, struct.pack, "357913941b", "a") + + def test_main(): run_unittest(StructTest) |