FromArrayFloatListRoundtripTest
Converting `[1.5, 2.5, 3.5]` to an `Array` with `Array.fromList` and back with `Array.toList` gives the same list. The test logs the reconstructed list as well as the result of comparing it with the original.
Results
elm-0.19.1
passran in 77 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.5,2.5,3.5] match: True
elm-0.19.2
passran in 72 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.5,2.5,3.5] match: True
elm-0.19.3
passran in 75 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.5,2.5,3.5] match: True
lamdera-1.5.0
passran in 84 msOutput
result: [1.5,2.5,3.5] match: True
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/FromArrayFloatListRoundtripTest] in its title.
Source
The -- CHECK: lines give the expected output.
module FromArrayFloatListRoundtripTest exposing (main)
{-| Converting `[1.5, 2.5, 3.5]` to an `Array` with `Array.fromList` and back with `Array.toList` gives the same list.
The test logs the reconstructed list as well as the result of comparing it with the original.
-}
-- CHECK: result: [1.5,2.5,3.5]
-- CHECK: match: True
import Array
import Html exposing (text)
main =
let
original = [1.5, 2.5, 3.5]
roundTrip = Array.toList (Array.fromList original)
_ = Debug.log "result" roundTrip
_ = Debug.log "match" (roundTrip == original)
in
text "done"