From d870214cb9e0b754b66cdcb3df785a6fa823e145 Mon Sep 17 00:00:00 2001 From: Omer Katz Date: Thu, 28 Feb 2019 11:57:25 +0200 Subject: The bitcount will reset only when we move to the next byte. Add a test to verify that parsing two consecutive bitmaps does not fail. --- t/unit/test_serialization.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/unit/test_serialization.py') diff --git a/t/unit/test_serialization.py b/t/unit/test_serialization.py index 3891090..b4165ae 100644 --- a/t/unit/test_serialization.py +++ b/t/unit/test_serialization.py @@ -105,6 +105,13 @@ class test_serialization: actual, _ = loads('BssbbbbbF', buf) assert actual == expected + def test_sixteen_bitflags(self): + expected = [True, False] * 8 + format = 'b' * len(expected) + buf = dumps(format, expected) + actual, _ = loads(format, buf) + assert actual == expected + class test_GenericContent: -- cgit v1.2.1