Elm Exactly
Results / elm-core /

CharLocaleCaseTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Char.toLocaleUpper` and `Char.toLocaleLower` of six characters with no locale-specific case
rules give the same results as `Char.toUpper` and `Char.toLower`.

The inputs are e acute, capital sigma, the titlecase digraph U+01C5, the Deseret small letter
U+10428, `'a'` and `'Z'`. Each is logged by its code points (`charCps` from `ConformanceHelp`),
with its locale upper and lower case.

Among what is not tested: `i`, `I` and the dotted and dotless i, whose mapping differs under
Turkish and Azeri rules, and any locale whose rules would change the results above.

Results

elm-0.19.1

passran in 59 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
E9 locUp: "C9"
E9 locLo: "E9"
3A3 locUp: "3A3"
3A3 locLo: "3C3"
1C5 locUp: "1C4"
1C5 locLo: "1C6"
10428 locUp: "10400"
10428 locLo: "10428"
61 locUp: "41"
61 locLo: "61"
5A locUp: "5A"
5A locLo: "7A"

elm-0.19.2

passran in 65 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
E9 locUp: "C9"
E9 locLo: "E9"
3A3 locUp: "3A3"
3A3 locLo: "3C3"
1C5 locUp: "1C4"
1C5 locLo: "1C6"
10428 locUp: "10400"
10428 locLo: "10428"
61 locUp: "41"
61 locLo: "61"
5A locUp: "5A"
5A locLo: "7A"

elm-0.19.3

passran in 47 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
E9 locUp: "C9"
E9 locLo: "E9"
3A3 locUp: "3A3"
3A3 locLo: "3C3"
1C5 locUp: "1C4"
1C5 locLo: "1C6"
10428 locUp: "10400"
10428 locLo: "10428"
61 locUp: "41"
61 locLo: "61"
5A locUp: "5A"
5A locLo: "7A"

lamdera-1.5.0

passran in 39 ms
Output
E9 locUp: "C9"
E9 locLo: "E9"
3A3 locUp: "3A3"
3A3 locLo: "3C3"
1C5 locUp: "1C4"
1C5 locLo: "1C6"
10428 locUp: "10400"
10428 locLo: "10428"
61 locUp: "41"
61 locLo: "61"
5A locUp: "5A"
5A locLo: "7A"

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module CharLocaleCaseTest exposing (main)
{-| `Char.toLocaleUpper` and `Char.toLocaleLower` of six characters with no locale-specific case
rules give the same results as `Char.toUpper` and `Char.toLower`.
The inputs are e acute, capital sigma, the titlecase digraph U+01C5, the Deseret small letter
U+10428, `'a'` and `'Z'`. Each is logged by its code points (`charCps` from `ConformanceHelp`),
with its locale upper and lower case.
Among what is not tested: `i`, `I` and the dotted and dotless i, whose mapping differs under
Turkish and Azeri rules, and any locale whose rules would change the results above.
-}
-- MODE-GUARD: a Char equality must give the same answer as under --optimize
-- NO-SKIP: an edge case every compiler must run
-- UNICODE: 17.0
-- CHECK: E9 locUp: "C9"
-- CHECK: E9 locLo: "E9"
-- CHECK: 3A3 locUp: "3A3"
-- CHECK: 3A3 locLo: "3C3"
-- CHECK: 1C5 locUp: "1C4"
-- CHECK: 1C5 locLo: "1C6"
-- CHECK: 10428 locUp: "10400"
-- CHECK: 10428 locLo: "10428"
-- CHECK: 61 locUp: "41"
-- CHECK: 61 locLo: "61"
-- CHECK: 5A locUp: "5A"
-- CHECK: 5A locLo: "7A"
import ConformanceHelp exposing (charCps, logAll, worker)
inputs : List Char
inputs =
[ '\u{00E9}', '\u{03A3}', '\u{01C5}', '\u{10428}', 'a', 'Z' ]
entries : Char -> List ( String, String )
entries c =
let
name =
charCps c
in
[ ( name ++ " locUp", charCps (Char.toLocaleUpper c) )
, ( name ++ " locLo", charCps (Char.toLocaleLower c) )
]
report : ()
report =
logAll (List.concatMap entries inputs)
main : Program () () ()
main =
worker report