- Notifications
You must be signed in to change notification settings - Fork 135
/
Copy pathNF-types.t
41 lines (28 loc) · 1.17 KB
/
NF-types.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
useTest;
plan10;
#### Tests both of the NFC and NFD types.
## NFC
# https://github.com/Raku/old-issue-tracker/issues/4136
#?rakudo 1 skip 'NFC quoting adverb NYI RT #124995'
{
isq:nfc"ẛ̣".WHAT, NFC, ":nfc adverb on quoteforms produces NFC string type.";
is "ẛ̣".NFC.WHAT, NFC, "Str literal can be converted to NFC.";
my $NFC = q:nfc'ẛ̣';
is $NFC.chars, 2, "NFC.charsreturns number of codepoints.";
is $NFC.codes, 2, "NFC.codesreturns number of codepoints.";
is $NFC.comb, <ẛ ̣>, "NFC correctly normalized ẛ̣";
# note: more "correctly normalized" tests needed, esp. wrt correct order of
# combining marks.
}
## NFD
# https://github.com/Raku/old-issue-tracker/issues/4137
#?rakudo 1 skip 'NFD quoting adverb NYI RT #124996'
{
isq:nfd"ẛ̣".WHAT, NFD, ":nfd adverb on quoteforms produces NFD string type.";
is "ẛ̣".NFD.WHAT, NFD, "Str literal can be converted to NFD.";
my $NFD = q:nfd'ẛ̣';
is $NFD.chars, 3, "NFD.charsreturns number of codepoints.";
is $NFD.codes, 3, "NFD.codesreturns number of codepoints.";
is $NFD.comb, <ſ ̣ ̇>, "NFD correctly normalized ẛ̣";
}
# vim: expandtab shiftwidth=4