diff options
author | Inada Naoki <songofacandy@gmail.com> | 2023-01-18 19:13:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 19:13:44 +0900 |
commit | b82d0b62f187552b8108602d7b0451ac362a29cc (patch) | |
tree | 96a036bdbf722df9df87c17c72cc87ae96f21454 /test | |
parent | c3995669f1f821596714240c2cd07943810f8658 (diff) | |
download | msgpack-python-b82d0b62f187552b8108602d7b0451ac362a29cc.tar.gz |
fallback: Fix packing multidim memoryview (#527)
Fix #526
Diffstat (limited to 'test')
-rw-r--r-- | test/test_memoryview.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_memoryview.py b/test/test_memoryview.py index 84941db..a0939a6 100644 --- a/test/test_memoryview.py +++ b/test/test_memoryview.py @@ -96,3 +96,11 @@ def test_bin32_from_byte(): def test_bin32_from_float(): _runtest("f", 2**16, b"\xc6", b"\x00\x01\x00\x00", True) + + +def test_multidim_memoryview(): + # See https://github.com/msgpack/msgpack-python/issues/526 + view = memoryview(b"\00" * 6) + data = view.cast(view.format, (3, 2)) + packed = packb(data) + assert packed == b'\xc4\x06\x00\x00\x00\x00\x00\x00' |