diff options
Diffstat (limited to 'Lib/test/test_getargs2.py')
-rw-r--r-- | Lib/test/test_getargs2.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index 5ade2b4..d751c1a 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -375,6 +375,16 @@ class Bytes_TestCase(unittest.TestCase): self.assertRaises(TypeError, getargs_y_hash, memoryview(b'memoryview')) self.assertRaises(TypeError, getargs_y_hash, None) + def test_w_star(self): + # getargs_w_star() modifies first and last byte + from _testcapi import getargs_w_star + self.assertRaises(TypeError, getargs_w_star, 'abc\xe9') + self.assertRaises(TypeError, getargs_w_star, b'bytes') + self.assertRaises(TypeError, getargs_w_star, b'nul:\0') + self.assertEqual(getargs_w_star(bytearray(b'bytearray')), b'[ytearra]') + self.assertEqual(getargs_w_star(memoryview(b'memoryview')), b'[emoryvie]') + self.assertRaises(TypeError, getargs_w_star, None) + class Unicode_TestCase(unittest.TestCase): def test_u(self): |