ListSortWithFloatCompareTest
Checks `List.sortWith compare` on a `List Float`, by printing the sorted list and comparing it with `[1.0, 2.0, 3.0]`.
Results
elm-0.19.1
passran in 83 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. result: [1,2,3] match: True
elm-0.19.2
passran in 42 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. result: [1,2,3] match: True
elm-0.19.3
passran in 59 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. result: [1,2,3] match: True
lamdera-1.5.0
passran in 94 msOutput
result: [1,2,3] match: True
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/ListSortWithFloatCompareTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ListSortWithFloatCompareTest exposing (main)
{-| Checks `List.sortWith compare` on a `List Float`, by printing the sorted list
and comparing it with `[1.0, 2.0, 3.0]`.
-}
-- CHECK: result: [1,2,3]
-- CHECK: match: True
import Html exposing (text)
main =
let
result =
List.sortWith compare [ 3.0, 1.0, 2.0 ]
_ =
Debug.log "result" result
_ =
Debug.log "match" (result == [ 1.0, 2.0, 3.0 ])
in
text "done"