Skip to content

Commit

Permalink
Add test for #526
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Jan 18, 2023
1 parent c399566 commit fd5551a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_memoryview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
view.cast(view.format, (3, 2))
packed = msgpack.packb(view)
assert packed == b'\xc4\x06\x00\x00\x00\x00\x00\x00'

0 comments on commit fd5551a

Please sign in to comment.