Skip to content

Commit ac52954

Browse files
committed
Add tests for <:LC>, <:Digit> and Line_Break = XX
Add regex tests for <:LC> (Letter Cased), <:Digit> (Numeric_Type=Digit) and that .uniprop('Line_Break') returns XX as its default value for unassigned codepoints.
1 parent c39830a commit ac52954

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

S05-mass/properties-general.t

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Unicode 5.2.
1515
1616
=end pod
1717

18-
plan 610;
18+
plan 614;
1919

2020
# L Letter
2121

@@ -51,7 +51,7 @@ ok(!( "\x[C767]" ~~ m/^<:Lu>$/ ), q{Don't match related <Lu> (UppercaseLetter)}
5151
ok("\x[C767]" ~~ m/^<:!Lu>$/, q{Match related negated <Lu> (UppercaseLetter)} );
5252
ok("\x[C767]" ~~ m/^<-:Lu>$/, q{Match related inverted <Lu> (UppercaseLetter)} );
5353
ok("\x[C767]\x[C767]\c[LATIN CAPITAL LETTER A]" ~~ m/<:Lu>/, q{Match unanchored <Lu> (UppercaseLetter)} );
54-
54+
ok("A" ~~ /<:LC>/, "Match letter 'Letter Uppercase' (LU)");
5555
ok("\c[LATIN CAPITAL LETTER A]" ~~ m/^<:UppercaseLetter>$/, q{Match <:UppercaseLetter>} );
5656
ok(!( "\c[LATIN CAPITAL LETTER A]" ~~ m/^<:!UppercaseLetter>$/ ), q{Don't match negated <UppercaseLetter>} );
5757
ok(!( "\c[LATIN CAPITAL LETTER A]" ~~ m/^<-:UppercaseLetter>$/ ), q{Don't match inverted <UppercaseLetter>} );
@@ -829,4 +829,7 @@ is ' ' ~~ m/<:White_Space>+/, ' ', '<:White_Space> matches space in regex';
829829
# https://github.com/MoarVM/MoarVM/issues/521
830830
is '' ~~ m/<alpha>/, '', '<alpha> matches alphabetics which are not Letters';
831831

832+
is 0x00B2.chr ~~ /<:Digit>/, 0x00B2.chr, "Digit matches Numeric_Type=Digit";
833+
nok "a" ~~ /<:Digit>/, "Digit doesn't match normal letters";
834+
nok "9" ~~ /<:Digit>/, "Digit doesn't match things with property value Decimal";
832835
# vim: ft=perl6

S15-unicode-information/uniprop.t

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 196;
5+
plan 198;
66

77
#use unicode :v(6.3);
88

@@ -112,6 +112,7 @@ is "½".uniprop('Numeric_Value'), 0.5, "'½'.uniprop('Numeric_Value') returns th
112112
is "a".uniprop('Numeric_Value'), NaN, "'a'.uniprop('Numeric_Value') returns NaN";
113113
is '1'.uniprop('Numeric_Type'), 'Decimal', "uniprop for Numeric_Type returns 'Decimal' for decimal numbers";
114114
is 'a'.uniprop('Numeric_Type'), 'None', "uniprop for Numeric_Type returns 'None' for non-numbers";
115+
is 0x00B2.uniprop('Numeric_Type'), 'Digit', "uniprop for Numeric_Type returns 'Digit' for ones with this property";
115116

116117
## Binary Properties
117118
is-deeply '0'.uniprop('Alphabetic'), False, "'0'.uniprop('Alphabetic') returns a False";
@@ -244,6 +245,7 @@ is 0xFB1F.uniprop('Word_Break'), 'Hebrew_Letter', "0xFB1F.uniprop('Word_Break')
244245
is "\n".uniprop('Line_Break'), 'LF', "\n".uniprop('Line_Break') return LF;
245246
is 0x200D.uniprop('Line_Break'), 'ZWJ', uniprop('Line_Break') returns ZWJ for U+200D ZERO WIDTH JOINER;
246247
is 0x103D.uniprop('Line_Break'), 'SA', uniprop('Line_Break') returns SA for U+103D MYANMAR CONSONANT SIGN MEDIAL WA;
248+
is 0xFFFF.uniprop('Line_Break'), 'XX', "uniprop('Line_Break') returns XX for noncharacters";
247249

248250
is 'Ö'.uniprop('Decomposition_Type'), 'Canonical', 'uniprop for Decomposition_Type returns Canonical for Canonical value codes';
249251
#?rakudo.moar 3 todo "MoarVM returns N/M/Y instead of their full names"

0 commit comments

Comments
 (0)