Skip to content

Commit 96e316b

Browse files
committed
Added test for concat where input stream is bytes
This illustrates a flaw with the reverted commits from PR #81 Refs #81
1 parent 7217c76 commit 96e316b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_parsy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ def test_concat(self):
162162
self.assertEqual(parser.parse(""), "")
163163
self.assertEqual(parser.parse("abc"), "abc")
164164

165+
def test_concat_from_byte_stream(self):
166+
any_byte = parsy_test_item(lambda c: True, "any byte")
167+
parser = any_byte.map(lambda b: b.decode("ascii")).many().concat()
168+
self.assertEqual(parser.parse(b""), "")
169+
self.assertEqual(parser.parse(b"abc"), "abc")
170+
165171
def test_generate(self):
166172
x = y = None
167173

0 commit comments

Comments
 (0)