Elm Exactly
Results / elm /

DebugLogOrderingTest

Tags:elm-unspecced

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
A sequence of `let` bindings of the form `_ = Debug.log ...` prints its lines
in source order, each exactly once.

The five bindings are all wildcards. The CHECK-NEXT lines require each label
to appear on the line straight after the previous one, so a line out of order,
missing or repeated fails the test.

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 55 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
a: "start"
b: "second"
c: "mid"
d: "fourth"
e: "end"

elm-0.19.2

passran in 74 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
a: "start"
b: "second"
c: "mid"
d: "fourth"
e: "end"

elm-0.19.3

passran in 67 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
a: "start"
b: "second"
c: "mid"
d: "fourth"
e: "end"

lamdera-1.5.0

passran in 49 ms
Output
a: "start"
b: "second"
c: "mid"
d: "fourth"
e: "end"

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm/DebugLogOrderingTest] in its title.

Source

The -- CHECK: lines give the expected output.

module DebugLogOrderingTest exposing (main)
{-| A sequence of `let` bindings of the form `_ = Debug.log ...` prints its lines
in source order, each exactly once.
The five bindings are all wildcards. The CHECK-NEXT lines require each label
to appear on the line straight after the previous one, so a line out of order,
missing or repeated fails the test.
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: a: "start"
-- CHECK-NEXT: b: "second"
-- CHECK-NEXT: c: "mid"
-- CHECK-NEXT: d: "fourth"
-- CHECK-NEXT: e: "end"
import Html exposing (text)
main : Html.Html msg
main =
let
_ =
Debug.log "a" "start"
_ =
Debug.log "b" "second"
_ =
Debug.log "c" "mid"
_ =
Debug.log "d" "fourth"
_ =
Debug.log "e" "end"
in
text "done"