Elm Exactly
Results / elm-core /

ListToArrayCharRoundtripTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
Converting a `List Char` to an array with `Array.fromList` and back with `Array.toList` gives the original list.

The test prints the round-tripped list and whether it is `==` to the original `['a','b','c']`.

Results

elm-0.19.1

passran in 67 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
result: ['a','b','c']
match: True

elm-0.19.2

passran in 69 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
result: ['a','b','c']
match: True

elm-0.19.3

passran in 71 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
match: True
result: ['a','b','c']

lamdera-1.5.0

passran in 65 ms
Output
match: True
result: ['a','b','c']

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module ListToArrayCharRoundtripTest exposing (main)
{-| Converting a `List Char` to an array with `Array.fromList` and back with `Array.toList` gives the original list.
The test prints the round-tripped list and whether it is `==` to the original `['a','b','c']`.
-}
-- CHECK: result: ['a','b','c']
-- CHECK: match: True
import Array
import Html exposing (text)
main =
let
xs =
[ 'a', 'b', 'c' ]
result =
Array.toList (Array.fromList xs)
_ =
Debug.log "result" result
_ =
Debug.log "match" (result == xs)
in
text "done"