Add unit test for ch
This commit is contained in:
@@ -244,12 +244,10 @@ let parseBetweenPair* = proc(delimiterParser: parserFnT): parserFnT {.closure.}
|
|||||||
# -- Tests
|
# -- Tests
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
let test1 = initParserResult("123")
|
let testParser123 = initParserResult("123")
|
||||||
|
|
||||||
|
block testBlockChar:
|
||||||
let ch1 = ch('1')
|
let ch1 = ch('1')
|
||||||
let chDigits = @[ch(Digits)]
|
let chDigits = ch(Digits)
|
||||||
|
assert testParser123.flatMap(ch1).tokensToString() == "1"
|
||||||
# echo type ch1
|
assert testParser123.flatMap(chDigits).tokensToString() == "1"
|
||||||
# echo test1.flatMap((x: Parser) => ParserResult.ok(x))
|
|
||||||
echo test1.flatMap(newlineParser)
|
|
||||||
# .flatMap(ch1)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user