Skip to content

Commit cde0b58

Browse files
committed
Test for at_least
1 parent 5b38aea commit cde0b58

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_parsy.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ def test_at_most(self):
275275
self.assertEqual(ab.at_most(2).parse("abab"), ["ab", "ab"])
276276
self.assertRaises(ParseError, ab.at_most(2).parse, "ababab")
277277

278+
def test_at_least(self):
279+
ab = string("ab")
280+
self.assertEqual(ab.at_least(2).parse("abab"), ["ab", "ab"])
281+
self.assertEqual(ab.at_least(2).parse("ababab"), ["ab", "ab", "ab"])
282+
self.assertRaises(ParseError, ab.at_least(2).parse, "ab")
283+
self.assertEqual(ab.at_least(2).parse_partial("abababc"), (["ab", "ab", "ab"], "c"))
284+
278285
def test_until(self):
279286

280287
until = string("s").until(string("x"))

0 commit comments

Comments
 (0)