Elm Exactly
Results / elm-json /

DecodeNullTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Json.Decode.null 0` decodes the JSON literal `null` to the given value `0`.

Results

elm-0.19.1

passran in 51 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
decode_null: Ok 0

elm-0.19.2

passran in 43 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
decode_null: Ok 0

elm-0.19.3

passran in 57 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
decode_null: Ok 0

lamdera-1.5.0

passran in 68 ms
Output
decode_null: Ok 0

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm-json/DecodeNullTest] in its title.

Source

The -- CHECK: lines give the expected output.

module DecodeNullTest exposing (main)
{-| `Json.Decode.null 0` decodes the JSON literal `null` to the given value `0`.
-}
-- CHECK: decode_null: Ok 0
import Html exposing (text)
import Json.Decode as Decode
main =
let
_ = Debug.log "decode_null" (Decode.decodeString (Decode.null 0) "null")
in
text "done"