Basis entryChar.toCode
Tests (11)
- elm / AstralCharLiteralTestA `Char` literal above U+FFFF has its full code point: `'\u{1F600}'` is 128512, and is the same character as `'😀'` written directly.
- elm / CharAstralClosureCaptureTestAn astral `Char` (code point above 0xFFFF) referred to by a lambda, or supplied as the first argument of a partially applied function, keeps its code point when the function is called later.
- elm / CharAstralCustomFieldTestAn astral `Char` (code point above 0xFFFF) stored in a custom-type constructor's field keeps its code point when read back by pattern matching.
- elm / CharAstralRecordFieldTestAn astral `Char` (code point above 0xFFFF) in a record field keeps its code point, next to an `Int` field and after a record update, and a record holding one is equal to a record literal with the same fields.
- elm / CharAstralTupleTestAn astral `Char` (code point above 0xFFFF) in a pair and in a 3-tuple keeps its code point when read back with a tuple pattern, in a function's argument and in a destructuring `let`. How `Debug.log` prints such tuples is checked by `CharAstralTupleShowTest`.
- elm / CharUnicodeTest`Char.toCode` of non-ASCII character literals written as `\u{...}` escapes gives their code points: 955 for U+03BB and 8364 for U+20AC.
- elm-core / CharAstralCodeTest`Char.fromCode` and `Char.toCode` round-trip Unicode code points, including astral ones (above 0xFFFF) and the largest, 0x10FFFF.
- elm-core / CharToCodeTest`Char.toCode` gives the code points 65, 97 and 48 for `'A'`, `'a'` and `'0'`.
- elm-core / CharToCodeThroughFunctionTest`Char.toCode` of a character returned from a top-level function, here an identity function applied to `'A'`, gives 65.
- elm-core / CoreIssue1150CharToCodeLoneSurrogateTest`Char.toCode` returns NaN, typed as `Int`, for a lone surrogate.
- elm-core / StandardA53CharOrderTestCharacters are ordered by their code points.
Discussions
Discuss this basis entry·Search the discussions on GitHub
Discussions are on GitHub; one about this basis entry has [b:Char.toCode] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.