DebugToStringTest
`Debug.toString` renders an Int, a Float, a Bool, a String (with its quotes), a list, a tuple, `Just 5` and `Nothing` as their Elm source text.
Results
elm-0.19.1
passran in 66 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. int_str: "42" float_str: "3.14" bool_str: "True" string_str: "\"hello\"" list_str: "[1,2,3]" tuple_str: "(1,2)" maybe_just_str: "Just 5" maybe_nothing_str: "Nothing"
elm-0.19.2
passran in 75 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. int_str: "42" float_str: "3.14" bool_str: "True" string_str: "\"hello\"" list_str: "[1,2,3]" tuple_str: "(1,2)" maybe_just_str: "Just 5" maybe_nothing_str: "Nothing"
elm-0.19.3
passran in 62 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. int_str: "42" float_str: "3.14" bool_str: "True" string_str: "\"hello\"" list_str: "[1,2,3]" tuple_str: "(1,2)" maybe_just_str: "Just 5" maybe_nothing_str: "Nothing"
lamdera-1.5.0
passran in 81 msOutput
int_str: "42" float_str: "3.14" bool_str: "True" string_str: "\"hello\"" list_str: "[1,2,3]" tuple_str: "(1,2)" maybe_just_str: "Just 5" maybe_nothing_str: "Nothing"
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/DebugToStringTest] in its title.
Source
The -- CHECK: lines give the expected output.
module DebugToStringTest exposing (main)
{-| `Debug.toString` renders an Int, a Float, a Bool, a String (with its quotes), a list, a
tuple, `Just 5` and `Nothing` as their Elm source text.
-}
-- CHECK: int_str: "42"
-- CHECK: float_str: "3.14"
-- CHECK: bool_str: "True"
-- CHECK: string_str: "\"hello\""
-- CHECK: list_str: "[1,2,3]"
-- CHECK: tuple_str: "(1,2)"
-- CHECK: maybe_just_str: "Just 5"
-- CHECK: maybe_nothing_str: "Nothing"
import Html exposing (text)
main =
let
_ = Debug.log "int_str" (Debug.toString 42)
_ = Debug.log "float_str" (Debug.toString 3.14)
_ = Debug.log "bool_str" (Debug.toString True)
_ = Debug.log "string_str" (Debug.toString "hello")
_ = Debug.log "list_str" (Debug.toString [1, 2, 3])
_ = Debug.log "tuple_str" (Debug.toString (1, 2))
_ = Debug.log "maybe_just_str" (Debug.toString (Just 5))
_ = Debug.log "maybe_nothing_str" (Debug.toString Nothing)
in
text "done"