Skip to content

Commit fd5551a

Browse files
committed
Add test for #526
1 parent c399566 commit fd5551a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test_memoryview.py

+8
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,11 @@ def test_bin32_from_byte():
9696

9797
def test_bin32_from_float():
9898
_runtest("f", 2**16, b"\xc6", b"\x00\x01\x00\x00", True)
99+
100+
101+
def test_multidim_memoryview():
102+
# See https://github.com/msgpack/msgpack-python/issues/526
103+
view = memoryview(b"\00" * 6)
104+
view.cast(view.format, (3, 2))
105+
packed = msgpack.packb(view)
106+
assert packed == b'\xc4\x06\x00\x00\x00\x00\x00\x00'

0 commit comments

Comments
 (0)