Elm Exactly
Results / elm-parser /

ParserChompUntilEndOrTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`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 ms
Output
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 ms
Output
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 ms
Output
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 ms
Output
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"