DecodeSucceedFailTest
`Json.Decode.succeed 99` produces `99` whatever the input; here the input is `null`.
Results
elm-0.19.1
passran in 77 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. succeed1: Ok 99
elm-0.19.2
passran in 39 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. succeed1: Ok 99
elm-0.19.3
passran in 40 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. succeed1: Ok 99
lamdera-1.5.0
passran in 85 msOutput
succeed1: Ok 99
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-json/DecodeSucceedFailTest] in its title.
Source
The -- CHECK: lines give the expected output.
module DecodeSucceedFailTest exposing (main)
{-| `Json.Decode.succeed 99` produces `99` whatever the input; here the input is `null`.
-}
-- CHECK: succeed1: Ok 99
import Html exposing (text)
import Json.Decode as Decode
main =
let
_ = Debug.log "succeed1" (Decode.decodeString (Decode.succeed 99) "null")
in
text "done"