Elm Exactly
Results / elm-core /

CharCaseSpecialTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Char.toUpper` and `Char.toLower` of U+1E9E (capital sharp s): the upper case is the character
itself and the lower case is U+00DF.

For each input the test logs the upper case and the lower case as code points (`charCps` from
`ConformanceHelp`), the upper case's `Char.toCode` (7838, that is U+1E9E), and the
`String.length` of the upper case as a one-character string, which is 1.

Results

elm-0.19.1

passran in 50 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
1E9E up: "1E9E"
1E9E lo: "DF"
1E9E upCode: "7838"
1E9E upLen: "1"

elm-0.19.2

passran in 81 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
1E9E up: "1E9E"
1E9E lo: "DF"
1E9E upCode: "7838"
1E9E upLen: "1"

elm-0.19.3

passran in 61 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
1E9E up: "1E9E"
1E9E lo: "DF"
1E9E upCode: "7838"
1E9E upLen: "1"

lamdera-1.5.0

passran in 49 ms
Output
1E9E up: "1E9E"
1E9E lo: "DF"
1E9E upCode: "7838"
1E9E upLen: "1"

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module CharCaseSpecialTest exposing (main)
{-| `Char.toUpper` and `Char.toLower` of U+1E9E (capital sharp s): the upper case is the character
itself and the lower case is U+00DF.
For each input the test logs the upper case and the lower case as code points (`charCps` from
`ConformanceHelp`), the upper case's `Char.toCode` (7838, that is U+1E9E), and the
`String.length` of the upper case as a one-character string, which is 1.
-}
-- 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: 1E9E up: "1E9E"
-- CHECK: 1E9E lo: "DF"
-- CHECK: 1E9E upCode: "7838"
-- CHECK: 1E9E upLen: "1"
import ConformanceHelp exposing (charCps, logAll, worker)
inputs : List ( String, Char )
inputs =
[ ( "1E9E", '\u{1E9E}' ) -- capital sharp s
]
entries : ( String, Char ) -> List ( String, String )
entries ( name, c ) =
[ ( name ++ " up", charCps (Char.toUpper c) )
, ( name ++ " lo", charCps (Char.toLower c) )
, ( name ++ " upCode", String.fromInt (Char.toCode (Char.toUpper c)) )
, ( name ++ " upLen", String.fromInt (String.length (String.fromChar (Char.toUpper c))) )
]
report : ()
report =
logAll (List.concatMap entries inputs)
main : Program () () ()
main =
worker report