DecodeBoolTest
`Json.Decode.bool` decodes the JSON literals `true` and `false` to `True` and `False`.
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. decode_true: Ok True decode_false: Ok False
elm-0.19.2
passran in 65 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. decode_true: Ok True decode_false: Ok False
elm-0.19.3
passran in 70 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. decode_true: Ok True decode_false: Ok False
lamdera-1.5.0
passran in 67 msOutput
decode_true: Ok True decode_false: Ok False
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-json/DecodeBoolTest] in its title.
Source
The -- CHECK: lines give the expected output.
module DecodeBoolTest exposing (main)
{-| `Json.Decode.bool` decodes the JSON literals `true` and `false` to `True` and `False`.
-}
-- CHECK: decode_true: Ok True
-- CHECK: decode_false: Ok False
import Html exposing (text)
import Json.Decode as Decode
main =
let
_ = Debug.log "decode_true" (Decode.decodeString Decode.bool "true")
_ = Debug.log "decode_false" (Decode.decodeString Decode.bool "false")
in
text "done"