arowM/elm-parser-test/1.0.2

NOTE: the latest version is 1.1.0

Parser.Test

Helper functions to develop/test your own parser using elm/parser.

Core

run : Parser a -> String -> ( Result (List DeadEnd) a, Bool )

Check if a parser is backtrackable or not.

import Parser


run (Parser.keyword "import") "imp" |> Tuple.mapFirst (Result.mapError (\_ -> ()))
--> (Err (), True)


run (Parser.keyword "import") "import"
--> (Ok (), False)


run Parser.spaces "  "
--> (Ok (), False)


run (Parser.backtrackable Parser.spaces) "  "
--> (Ok (), True)