gh-121842: Improve coverage of PyBytes_FromStringAndSize (#121843)

This commit is contained in:
sobolevn 2024-07-17 10:00:07 +03:00 committed by GitHub
parent 37611171af
commit f6c7d8d79c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,8 @@ def test_fromstringandsize(self):
self.assertEqual(fromstringandsize(b'abc'), b'abc')
self.assertEqual(fromstringandsize(b'abc', 2), b'ab')
self.assertEqual(fromstringandsize(b'abc\0def'), b'abc\0def')
self.assertEqual(fromstringandsize(b'a'), b'a')
self.assertEqual(fromstringandsize(b'a', 1), b'a')
self.assertEqual(fromstringandsize(b'', 0), b'')
self.assertEqual(fromstringandsize(NULL, 0), b'')
self.assertEqual(len(fromstringandsize(NULL, 3)), 3)