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