Skip to content
Snippets Groups Projects
Commit 58d9b10d authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests: Split byteorder-dependent tests to *_endian.py's.

parent 0a8b5d16
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ print(array('b', (1, 2)))
print(array('h', [1, 2]))
# raw copy from bytes, bytearray
print(array('h', b'12'))
print(array('h', b'22')) # should be byteorder-neutral
print(array('h', bytearray(2)))
print(array('i', bytearray(4)))
......
# test construction of array.array from different objects
from array import array
# raw copy from bytes, bytearray
print(array('h', b'12'))
......@@ -9,5 +9,4 @@ print(bytearray([1, 2]))
# arrays
print(bytearray(array('b', [1, 2])))
print(bytearray(array('h', [1, 2])))
print(bytearray(array('I', [1, 2])))
print(bytearray(array('h', [0x101, 0x202])))
# test construction of bytearray from different objects
from array import array
# arrays
print(bytearray(array('h', [1, 2])))
print(bytearray(array('I', [1, 2])))
......@@ -5,5 +5,7 @@ print(b"123" + bytearray(2))
import array
print(b"123" + array.array('i', [1]))
# should be byteorder-neutral
print(b"123" + array.array('h', [0x1515]))
print(b"\x01\x02" + array.array('b', [1, 2]))
# test bytes + other
import array
print(b"123" + array.array('i', [1]))
......@@ -9,8 +9,7 @@ print(bytes(bytearray(4)))
# arrays
print(bytes(array('b', [1, 2])))
print(bytes(array('h', [1, 2])))
print(bytes(array('I', [1, 2])))
print(bytes(array('h', [0x101, 0x202])))
# long ints
print(ord(bytes([14953042807679334000 & 0xff])))
......
# test construction of bytes from different objects
from array import array
# arrays
print(bytes(array('h', [1, 2])))
print(bytes(array('I', [1, 2])))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment