CharAstralDebugLogTest
`Debug.log` prints an astral `Char` (code point above 0xFFFF) as the character itself in single quotes, whether written as a literal, made with `Char.fromCode`, or inside `Just`, and prints a non-ASCII character below 0xFFFF, `'โฌ'`, the same way.
Results
elm-0.19.1
passran in 61 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. dbg_astral: '๐' dbg_fromcode: '๐' dbg_bmp: 'โฌ' dbg_maybe: Just '๐'
elm-0.19.2
passran in 57 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. dbg_astral: '๐' dbg_fromcode: '๐' dbg_bmp: 'โฌ' dbg_maybe: Just '๐'
elm-0.19.3
passran in 67 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. dbg_astral: '๐' dbg_fromcode: '๐' dbg_bmp: 'โฌ' dbg_maybe: Just '๐'
lamdera-1.5.0
passran in 45 msOutput
dbg_astral: '๐' dbg_fromcode: '๐' dbg_bmp: 'โฌ' dbg_maybe: Just '๐'
Discussions
Discuss this testยทSearch the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/CharAstralDebugLogTest] in its title.
Source
The -- CHECK: lines give the expected output.
module CharAstralDebugLogTest exposing (main)
{-| `Debug.log` prints an astral `Char` (code point above 0xFFFF) as the
character itself in single quotes, whether written as a literal, made with
`Char.fromCode`, or inside `Just`, and prints a non-ASCII character below
0xFFFF, `'โฌ'`, the same way.
-}
-- CHECK: dbg_astral: '๐'
-- CHECK: dbg_fromcode: '๐'
-- CHECK: dbg_bmp: 'โฌ'
-- CHECK: dbg_maybe: Just '๐'
import Html exposing (text)
main =
let
_ =
Debug.log "dbg_astral" '๐'
_ =
Debug.log "dbg_fromcode" (Char.fromCode 0x0001D11E)
_ =
Debug.log "dbg_bmp" 'โฌ'
_ =
Debug.log "dbg_maybe" (Just '๐')
in
text "done"