Skip to content

Commit 03f5fc7

Browse files
committed
1 parent 2ad0fbe commit 03f5fc7

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

S05-mass/charsets.t

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ plan 17;
2020

2121
is $latin-chars.comb(/<alnum>/).join, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzªµºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ", 'alnum chars';
2222

23+
#?rakudo.parrot todo 'blank characters'
2324
is $latin-chars.comb(/<blank>/)>>.ord.join(","), '9,32,160', 'blank chars';
2425

2526
is $latin-chars.comb(/<cntrl>/)>>.ord.join(","), ((0..31, 127..159).join(",")), 'cntrl chars';
@@ -28,15 +29,27 @@ plan 17;
2829
#?rakudo.jvm todo 'Unicode 6.3 -- lower characters'
2930
is $latin-chars.comb(/<lower>/).join, "abcdefghijklmnopqrstuvwxyzµßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ", 'lower chars';
3031

31-
#++ FLAPPERS on jvm/parrot
32-
# unicode 6.1 reclassifies § and ¶ as punctuation characters, so actual results may vary depending
32+
# unicode 6.1 reclassifies punctuation characters, so actual results may vary depending
3333
# on unicode version bundled with jdk, icu etc.
34-
#?rakudo.parrot todo 'punct characters'
35-
#?rakudo.jvm todo 'Unicode 6.1 -- punct characters'
36-
is $latin-chars.comb(/<punct>/).join, q<!"#%&'()*,-./:;?@[\]_{}¡§«¶·»¿>, 'punct chars';
37-
#?rakudo.jvm todo 'Unicode 6.1 -- :Punctuation characters'
38-
is $latin-chars.comb(/<:Punctuation>/).join, q<!"#%&'()*,-./:;?@[\]_{}¡§«¶·»¿>, ':Punctuation chars';
39-
#-- FLAPPERS
34+
35+
my $punct-chars := q<!"#%&'()*,-./:;?@[\]_{}¡§«¶·»¿>;
36+
my $punct-chars-pre61 := q<!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~> ~ chr(160) ~ q<¡¢£¤¥¦§¨©«¬­®¯°±²³´¶·¸¹»¼½¾¿×÷>;
37+
my $punct := $latin-chars.comb(/<punct>/).join;
38+
39+
ok ($punct eq $punct-chars || $punct eq $punct-chars-pre61), 'punct chars'
40+
or diag "punct: $punct";
41+
my @punct = $punct.comb;
42+
my @punct-chars-pre61 = $punct-chars-pre61.comb;
43+
for @punct.keys {
44+
say "@punct[$_]: {ord(@punct[$_])} {ord(@punct-chars-pre61[$_])}";
45+
}
46+
47+
$punct-chars := q<!"#%&'()*,-./:;?@[\]_{}¡§«¶·»¿>;
48+
$punct-chars-pre61 := q<!"#%&'()*,-./:;?@[\]_{}¡«·»¿>;
49+
$punct := $latin-chars.comb(/<:Punctuation>/).join;
50+
51+
ok $punct eq $punct-chars || $punct eq $punct-chars-pre61, ':Punctuation chars'
52+
or diag ":Punctuation: $punct";
4053

4154
is $latin-chars.comb(/<upper>/).join, "ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ", 'upper chars';
4255

0 commit comments

Comments
 (0)