Skip to content

Commit bf0d6e4

Browse files
A couple more test cases.
1 parent f693888 commit bf0d6e4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_bitstring.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ class NoFixedLengthPackingBug(unittest.TestCase):
184184
def testPackingBytesWithNoLength(self):
185185
a = bitstring.pack('bytes', b'abcd')
186186
self.assertEqual(a.bytes, b'abcd')
187+
b = bitstring.pack('u12, bytes, bool', 0, b'deadbeef', True)
188+
self.assertEqual(b.unpack('u12, bytes, bool'), [0, b'deadbeef', True])
187189

188190
def testPackingBinWithNoLength(self):
189191
a = bitstring.pack('bin', '0001')
@@ -197,6 +199,11 @@ def testReadingBytesWithNoLength(self):
197199
a = bitstring.BitStream(b'hello')
198200
b = a.read('bytes')
199201
self.assertEqual(b, b'hello')
202+
c = bitstring.BitStream('0xabc, u13=99')
203+
c += b'123abc'
204+
c += bitstring.Bits('bfloat=4')
205+
c.pos = 0
206+
self.assertEqual(c.readlist('h12, u13, bytes, bfloat'), ['abc', 99, b'123abc', 4.0])
200207

201208
def testReadingBinWithNoLength(self):
202209
a = bitstring.BitStream('0b1101')

0 commit comments

Comments
 (0)