Kaydet (Commit) 0638a08a authored tarafından Georg Brandl's avatar Georg Brandl

#3694: add test for fix committed in r66693.

üst 5ccf2ae2
...@@ -512,6 +512,10 @@ class StructTest(unittest.TestCase): ...@@ -512,6 +512,10 @@ class StructTest(unittest.TestCase):
self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string) self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string)
self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string) self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string)
# Test bogus offset (issue 3694)
sb = small_buf
self.assertRaises(TypeError, struct.pack_into, b'1', sb, None)
def test_pack_into_fn(self): def test_pack_into_fn(self):
test_string = 'Reykjavik rocks, eow!' test_string = 'Reykjavik rocks, eow!'
writable_buf = array.array('c', ' '*100) writable_buf = array.array('c', ' '*100)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment