Skip to content

Commit

Permalink
Added test for concat where input stream is bytes
Browse files Browse the repository at this point in the history
This illustrates a flaw with the reverted commits from PR #81

Refs #81
  • Loading branch information
spookylukey committed May 2, 2024
1 parent 7217c76 commit 96e316b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_parsy.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ def test_concat(self):
self.assertEqual(parser.parse(""), "")
self.assertEqual(parser.parse("abc"), "abc")

def test_concat_from_byte_stream(self):
any_byte = parsy_test_item(lambda c: True, "any byte")
parser = any_byte.map(lambda b: b.decode("ascii")).many().concat()
self.assertEqual(parser.parse(b""), "")
self.assertEqual(parser.parse(b"abc"), "abc")

def test_generate(self):
x = y = None

Expand Down

0 comments on commit 96e316b

Please sign in to comment.