RoundTripNullTest
`Json.Encode.null` decodes with `Json.Decode.null 0` to 0, the value passed to `null`.
Results
elm-0.19.1
passran in 45 msOutput
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 msOutput
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 msOutput
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 msOutput
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"