mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
array module uses the new Unicode API
* Use Py_UCS4* buffer instead of Py_UNICODE* * Use "I" or "L" format, instead of "u" format
This commit is contained in:
parent
f8bb7d02f6
commit
8dba4e004f
2 changed files with 36 additions and 35 deletions
|
@ -218,10 +218,14 @@ class BaseTest(unittest.TestCase):
|
|||
self.assertEqual(bi[1], len(a))
|
||||
|
||||
def test_byteswap(self):
|
||||
a = array.array(self.typecode, self.example)
|
||||
if self.typecode == 'u':
|
||||
example = '\U00100100'
|
||||
else:
|
||||
example = self.example
|
||||
a = array.array(self.typecode, example)
|
||||
self.assertRaises(TypeError, a.byteswap, 42)
|
||||
if a.itemsize in (1, 2, 4, 8):
|
||||
b = array.array(self.typecode, self.example)
|
||||
b = array.array(self.typecode, example)
|
||||
b.byteswap()
|
||||
if a.itemsize==1:
|
||||
self.assertEqual(a, b)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue