RoundTripNegativeIntTest
The negative integer -7 encoded with `Json.Encode.int` decodes back to -7 with `Json.Decode.int`.
Results
elm-0.19.1
passran in 55 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. rt_neg_int: Ok -7
elm-0.19.2
passran in 56 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. rt_neg_int: Ok -7
elm-0.19.3
passran in 43 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. rt_neg_int: Ok -7
lamdera-1.5.0
passran in 56 msOutput
rt_neg_int: Ok -7
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-json/RoundTripNegativeIntTest] in its title.
Source
The -- CHECK: lines give the expected output.
module RoundTripNegativeIntTest exposing (main)
{-| The negative integer -7 encoded with `Json.Encode.int` decodes back to -7 with `Json.Decode.int`.
-}
-- CHECK: rt_neg_int: Ok -7
import Html exposing (text)
import Json.Decode as Decode
import Json.Encode as Encode
main =
let
_ = Debug.log "rt_neg_int" (Decode.decodeString Decode.int (Encode.encode 0 (Encode.int -7)))
in
text "done"