Elm Exactly
Results / elm-json /

RoundTripBoolTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`True` and `False` encoded with `Json.Encode.bool` decode back to the same values with `Json.Decode.bool`.

Results

elm-0.19.1

passran in 74 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_true: Ok True
rt_false: Ok False

elm-0.19.2

passran in 50 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_true: Ok True
rt_false: Ok False

elm-0.19.3

passran in 77 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_true: Ok True
rt_false: Ok False

lamdera-1.5.0

passran in 54 ms
Output
rt_true: Ok True
rt_false: Ok False

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module RoundTripBoolTest exposing (main)
{-| `True` and `False` encoded with `Json.Encode.bool` decode back to the same values with `Json.Decode.bool`.
-}
-- CHECK: rt_true: Ok True
-- CHECK: rt_false: Ok False
import Html exposing (text)
import Json.Decode as Decode
import Json.Encode as Encode
main =
let
_ = Debug.log "rt_true" (Decode.decodeString Decode.bool (Encode.encode 0 (Encode.bool True)))
_ = Debug.log "rt_false" (Decode.decodeString Decode.bool (Encode.encode 0 (Encode.bool False)))
in
text "done"