StringFromNumberIntTest
`String.fromInt` prints zero, positive and negative integers, including the 32-bit signed limits `2147483647` and `-2147483648`.
Results
elm-0.19.1
passran in 37 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. zero: "0" positive: "12345" negative: "-67" max_i32: "2147483647" min_i32: "-2147483648"
elm-0.19.2
passran in 38 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. zero: "0" positive: "12345" negative: "-67" max_i32: "2147483647" min_i32: "-2147483648"
elm-0.19.3
passran in 61 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. zero: "0" positive: "12345" negative: "-67" max_i32: "2147483647" min_i32: "-2147483648"
lamdera-1.5.0
passran in 58 msOutput
zero: "0" positive: "12345" negative: "-67" max_i32: "2147483647" min_i32: "-2147483648"
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/StringFromNumberIntTest] in its title.
Source
The -- CHECK: lines give the expected output.
module StringFromNumberIntTest exposing (main)
{-| `String.fromInt` prints zero, positive and negative integers, including the 32-bit
signed limits `2147483647` and `-2147483648`.
-}
-- CHECK: zero: "0"
-- CHECK: positive: "12345"
-- CHECK: negative: "-67"
-- CHECK: max_i32: "2147483647"
-- CHECK: min_i32: "-2147483648"
import Html exposing (text)
main =
let
_ =
Debug.log "zero" (String.fromInt 0)
_ =
Debug.log "positive" (String.fromInt 12345)
_ =
Debug.log "negative" (String.fromInt -67)
_ =
Debug.log "max_i32" (String.fromInt 2147483647)
_ =
Debug.log "min_i32" (String.fromInt -2147483648)
in
text "done"