Results / elm-parser /
ParserSpacesTest
Checks that `Parser.spaces` skips whitespace around a value: `" 42 "` gives `Ok 42`.
Results
elm-0.19.1
passran in 56 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. result: Ok 42
elm-0.19.2
passran in 56 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. result: Ok 42
elm-0.19.3
passran in 65 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. result: Ok 42
lamdera-1.5.0
passran in 49 msOutput
result: Ok 42
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-parser/ParserSpacesTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ParserSpacesTest exposing (main)
{-| Checks that `Parser.spaces` skips whitespace around a value: `" 42 "` gives `Ok 42`.
-}
-- CHECK: result: Ok 42
import Html exposing (text)
import Parser exposing ((|.), (|=))
p : Parser.Parser Int
p =
Parser.succeed identity
|. Parser.spaces
|= Parser.int
|. Parser.spaces
main =
let
result = Parser.run p " 42 "
_ = Debug.log "result" result
in
text "done"