Results / elm-parser /
ParserChompUntilEndOrTest
`Parser.chompUntilEndOr` chomps to the end of the input when the closing string never appears. The closing string is `"}"` and the input `"abc"` has none, so `getChompedString` returns `Ok "abc"`. Among what is not tested: input that does contain the closing string.
Results
elm-0.19.1
passran in 58 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. chomped: Ok "abc"
elm-0.19.2
passran in 76 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. chomped: Ok "abc"
elm-0.19.3
passran in 55 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. chomped: Ok "abc"
lamdera-1.5.0
passran in 56 msOutput
chomped: Ok "abc"
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-parser/ParserChompUntilEndOrTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ParserChompUntilEndOrTest exposing (main)
{-| `Parser.chompUntilEndOr` chomps to the end of the input when the closing string never appears.
The closing string is `"}"` and the input `"abc"` has none, so
`getChompedString` returns `Ok "abc"`.
Among what is not tested: input that does contain the closing string.
-}
-- CHECK: chomped: Ok "abc"
import Html exposing (text)
import Parser
main =
let
p = Parser.getChompedString (Parser.chompUntilEndOr "}")
result = Parser.run p "abc"
_ = Debug.log "chomped" result
in
text "done"