Elm Exactly
Results / elm-json /

RoundTripNullTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Json.Encode.null` decodes with `Json.Decode.null 0` to 0, the value passed to `null`.

Results

elm-0.19.1

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

elm-0.19.2

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

elm-0.19.3

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

lamdera-1.5.0

passran in 43 ms
Output
rt_null: Ok 0

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module RoundTripNullTest exposing (main)
{-| `Json.Encode.null` decodes with `Json.Decode.null 0` to 0, the value passed to `null`.
-}
-- CHECK: rt_null: Ok 0
import Html exposing (text)
import Json.Decode as Decode
import Json.Encode as Encode
main =
let
_ = Debug.log "rt_null" (Decode.decodeString (Decode.null 0) (Encode.encode 0 Encode.null))
in
text "done"