DebugInternalsTest
`Debug.toString` prints an `Html` node or a `Json.Encode.Value` as `<internals>`. These are opaque values whose contents `Debug.toString` does not show. The test logs an element with an attribute and a child, a bare text node, an encoded JSON string, and a tuple holding a text node and an `Int`, where only the node is replaced by `<internals>`.
Results
elm-0.19.1
passran in 123 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. html: <internals> text: <internals> json: <internals> pair: (<internals>,1)
elm-0.19.2
passran in 73 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. html: <internals> text: <internals> json: <internals> pair: (<internals>,1)
elm-0.19.3
passran in 44 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. html: <internals> text: <internals> json: <internals> pair: (<internals>,1)
lamdera-1.5.0
passran in 83 msOutput
html: <internals> text: <internals> json: <internals> pair: (<internals>,1)
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/DebugInternalsTest] in its title.
Source
The -- CHECK: lines give the expected output.
module DebugInternalsTest exposing (main)
{-| `Debug.toString` prints an `Html` node or a `Json.Encode.Value` as `<internals>`.
These are opaque values whose contents `Debug.toString` does not show. The test
logs an element with an attribute and a child, a bare text node, an encoded
JSON string, and a tuple holding a text node and an `Int`, where only the node
is replaced by `<internals>`.
-}
-- CHECK: html: <internals>
-- CHECK: text: <internals>
-- CHECK: json: <internals>
-- CHECK: pair: (<internals>,1)
import Html
import Html.Attributes
import Json.Encode
main =
let
_ =
Debug.log "html" (Html.div [ Html.Attributes.id "x" ] [ Html.text "x" ])
_ =
Debug.log "text" (Html.text "x")
_ =
Debug.log "json" (Json.Encode.string "x")
_ =
Debug.log "pair" ( Html.text "y", 1 )
in
Html.text "done"