Skip to content
Prev Previous commit
Next Next commit
Add regression test
  • Loading branch information
mdickinson committed Sep 10, 2022
commit e12943b091dfb3e9b606f415024dfdd28caf3ba1
7 changes: 7 additions & 0 deletions Lib/test/test_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,13 @@ def test_issue45034_signed(self):
with self.assertRaisesRegex(struct.error, error_msg):
struct.pack('h', -70000) # too small

def test_long_long_unpack_undefined_behaviour(self):
# Regression test for python/cpython#96735.
self.assertEqual(
struct.unpack('!q', b'\xff\xff\xff\xff\xff\xff\xff\xff'),
(-1,)
)


class UnpackIteratorTest(unittest.TestCase):
"""
Expand Down