Add manyUntil test
This commit is contained in:
@@ -253,9 +253,12 @@ when isMainModule:
|
|||||||
assert testParser123.flatMap(str("123")).isStreamCompleted() == true
|
assert testParser123.flatMap(str("123")).isStreamCompleted() == true
|
||||||
|
|
||||||
block testParsingApi:
|
block testParsingApi:
|
||||||
# Optional
|
# optional
|
||||||
assert testParser123.flatMap(optional(ch('1'))).tokensToString() == "1"
|
assert testParser123.flatMap(optional(ch('1'))).tokensToString() == "1"
|
||||||
assert testParser123.flatMap(optional(ch('2'))).tokensToString() == ""
|
assert testParser123.flatMap(optional(ch('2'))).tokensToString() == ""
|
||||||
|
|
||||||
# Ignore
|
# ignore
|
||||||
assert testParser123.flatMap(ignore(ch('1'))).tokensToString() == ""
|
assert testParser123.flatMap(ignore(ch('1'))).tokensToString() == ""
|
||||||
|
|
||||||
|
# manyUntil
|
||||||
|
assert initParserResult("abc1").flatMap(manyUntil(anyCh, digit)).tokensToString() == "abc"
|
||||||
|
|||||||
Reference in New Issue
Block a user