CustomTypeBasicTest
Tags:elm-unspecced
`Debug.log` prints each constructor of a custom type with no arguments by its name. The test logs `Red`, `Green` and `Blue` of the type `Color`. A Standard Definition of Elm? does not decide this test: `Debug.log l v` evaluates to `v`, and any output it makes, its text, its order and whether it is made at all, is outside the definition (ruling A62).
Results
elm-0.19.1
passran in 48 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. color1: Red color2: Green color3: Blue
elm-0.19.2
passran in 78 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. color1: Red color2: Green color3: Blue
elm-0.19.3
passran in 54 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. color1: Red color2: Green color3: Blue
lamdera-1.5.0
passran in 59 msOutput
color1: Red color2: Green color3: Blue
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm/CustomTypeBasicTest] in its title.
Source
The -- CHECK: lines give the expected output.
module CustomTypeBasicTest exposing (main)
{-| `Debug.log` prints each constructor of a custom type with no arguments by its
name.
The test logs `Red`, `Green` and `Blue` of the type `Color`.
A Standard Definition of Elm? does not decide this test: `Debug.log l v` evaluates to `v`, and any
output it makes, its text, its order and whether it is made at all, is outside the definition
(ruling A62).
-}
-- TAGS: elm-unspecced
-- CHECK: color1: Red
-- CHECK: color2: Green
-- CHECK: color3: Blue
import Html exposing (text)
type Color
= Red
| Green
| Blue
main =
let
_ = Debug.log "color1" Red
_ = Debug.log "color2" Green
_ = Debug.log "color3" Blue
in
text "done"