ArrayUnsafeGetCharElementTest
`Array.get 1` on an `Array Char` of `'x'` and `'y'` returns `Just 'y'`.
Results
elm-0.19.1
passran in 50 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. result: Just 'y' match: True
elm-0.19.2
passran in 86 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. result: Just 'y' match: True
elm-0.19.3
passran in 68 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. result: Just 'y' match: True
lamdera-1.5.0
passran in 62 msOutput
result: Just 'y' match: True
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/ArrayUnsafeGetCharElementTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ArrayUnsafeGetCharElementTest exposing (main)
{-| `Array.get 1` on an `Array Char` of `'x'` and `'y'` returns `Just 'y'`.
-}
-- CHECK: result: Just 'y'
-- CHECK: match: True
import Array
import Html exposing (text)
main =
let
arr =
Array.fromList [ 'x', 'y' ]
result =
Array.get 1 arr
_ =
Debug.log "result" result
_ =
Debug.log "match" (result == Just 'y')
in
text "done"