From a17755ee8ba2982505d349e0f06acdabe943d33e Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Wed, 23 Dec 2015 19:11:27 -0800 Subject: py: Add ustruct.pack_into and unpack_from --- tests/basics/struct1.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tests/basics/struct1.py') diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py index 61c08b74e4..1afea5a96f 100644 --- a/tests/basics/struct1.py +++ b/tests/basics/struct1.py @@ -66,3 +66,44 @@ except TypeError: # but later were implemented for all. print(struct.unpack("<3B2h", b"foo\x12\x34\xff\xff")) print(struct.pack("<3B", 1, 2, 3)) + +# pack_into +buf = bytearray(b'>>>123<<<') +struct.pack_into('