Skip to content

Commit ed3f324

Browse files
committed
uniprop: add tests for 9 more properties
Cased, Changes_When_Casefolded, Changes_When_Casemapped, Changes_When_Lowercased, Changes_When_Uppercased, Changes_When_Titlecased, Uppercase, Terminal_Punctuation, Bidi_Control
1 parent 1c498de commit ed3f324

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

S15-unicode-information/uniprop.t

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

33
use Test;
44

5-
plan 125;
5+
plan 143;
66

77
#use unicode :v(6.3);
88

@@ -22,11 +22,13 @@ plan 125;
2222

2323
## Miscellaneous Properties [5/19]
2424
# Unicode_1_Name, Name, Jamo_Short_Name, ISO_Comment, Bidi_Mirroring_Glyph
25-
## Binary [24/60]
25+
## Binary [33/60]
2626
# ASCII_Hex_Digit, Hex_Digit, Dash, Case_Ignorable, Soft_Dotted, Quotation_Mark, Math
2727
# Grapheme_Extend, Hyphen, Extender, Grapheme_Base, Join_Control, Grapheme_Link
2828
# Deprecated, White_Space, Ideographic, Radical, Alphabetic, Bidi_Mirrored, Variation_Selector
2929
# ID_Continue, Sentence_Terminal, Changes_When_NFKC_Casefolded, Full_Composition_Exclusion
30+
# Cased, Changes_When_Casefolded, Changes_When_Casemapped, Changes_When_Lowercased
31+
# Changes_When_Uppercased, Changes_When_Titlecased, Uppercase, Terminal_Punctuation, Bidi_Control
3032

3133
## Catalog Properties [3/3]
3234
# Script, Age, Block
@@ -42,7 +44,7 @@ plan 125;
4244
# Emoji, Emoji_Modifier, Emoji_All, Emoji_Presentation
4345

4446

45-
#?niecza 125 skip "uniprop NYI"
47+
#?niecza 143 skip "uniprop NYI"
4648
is uniprop(""), Nil, "uniprop an empty string yields Nil";
4749
is "".uniprop, Nil, "''.uniprop yields Nil";
4850
throws-like "uniprop Str", X::Multi::NoMatch, 'cannot call uniprop with a Str';
@@ -175,12 +177,41 @@ is-deeply 'a'.uniprop('Sentence_Terminal'), False, "uniprop for Sentence_Termina
175177
is-deeply '🄡'.uniprop('Changes_When_NFKC_Casefolded'), True, "uniprop for Changes_When_NFKC_Casefolded property returns True for codes with this property";
176178
is-deeply 'a'.uniprop('Changes_When_NFKC_Casefolded'), False, "uniprop for Sentence_Terminal property returns False for codes without this property";
177179

180+
is-deeply 'a'.uniprop('Cased'), True, "uniprop for Cased property returns True for codes with this property";
181+
is-deeply '0'.uniprop('Cased'), False, "uniprop for Cased property returns False for codes without this property";
182+
178183
# The following two tests cannot be tested as strings/chars because of Unicode normalization.
179184
# Encoding it as a string will change the codepoint, so do not try this! It will give the incorrect
180185
# answer!
181186
is-deeply 0x0343.uniprop('Full_Composition_Exclusion'), True, "uniprop for Full_Composition_Exclusion property returns True for codes with this property";
182187
is-deeply 'a'.uniprop('Full_Composition_Exclusion'), False, "uniprop for Full_Composition_Exclusion property returns False for codes without this property";
183188

189+
is-deeply 'A'.uniprop('Changes_When_Casefolded'), True, "uniprop for Changes_When_Casefolded property returns True for codes with this property";
190+
is-deeply 'a'.uniprop('Changes_When_Casefolded'), False, "uniprop for Changes_When_Casefolded property returns False for codes without this property";
191+
192+
is-deeply 'A'.uniprop('Changes_When_Lowercased'), True, "uniprop for Changes_When_Lowercased property returns True for codes with this property";
193+
is-deeply 'a'.uniprop('Changes_When_Lowercased'), False, "uniprop for Changes_When_Lowercased property returns False for codes without this property";
194+
195+
is-deeply 'A'.uniprop('Changes_When_Uppercased'), False, "uniprop for Changes_When_Uppercased property returns False for codes with this property";
196+
is-deeply 'a'.uniprop('Changes_When_Uppercased'), True, "uniprop for Changes_When_Uppercased property returns True for codes without this property";
197+
198+
is-deeply 'A'.uniprop('Changes_When_Titlecased'), False, "uniprop for Changes_When_Titlecased property returns False for codes with this property";
199+
is-deeply 'a'.uniprop('Changes_When_Titlecased'), True, "uniprop for Changes_When_Titlecased property returns True for codes without this property";
200+
201+
is-deeply ''.uniprop('Changes_When_Casemapped'), True, "uniprop for Changes_When_Casemapped property returns True for codes with this property";
202+
is-deeply ''.uniprop('Changes_When_Casemapped'), False, "uniprop for Changes_When_Casemapped property returns False for codes without this property";
203+
204+
is-deeply 'A'.uniprop('Uppercase'), True, "uniprop for 'Upper' property returns False for codes with this property";
205+
is-deeply 'a'.uniprop('Uppercase'), False, "uniprop for 'Upper' property returns True for codes without this property";
206+
207+
is-deeply 'A'.uniprop('Lowercase'), False, "uniprop for 'Lowercase' property returns False for codes with this property";
208+
is-deeply 'a'.uniprop('Lowercase'), True, "uniprop for 'Lowercase' property returns True for codes without this property";
209+
210+
is-deeply 'A'.uniprop('Terminal_Punctuation'), False, "uniprop for Terminal_Punctuation property returns False for codes with this property";
211+
is-deeply ''.uniprop('Terminal_Punctuation'), True, "uniprop for Terminal_Punctuation property returns True for codes without this property";
212+
213+
is-deeply 'A'.uniprop('Bidi_Control'), False, "uniprop for 'Bidi_Control' property returns False for codes with this property";
214+
is-deeply 0x202D.uniprop('Bidi_Control'), True, "uniprop for 'Bidi_Control' property returns True for codes without this property";
184215

185216
## Enum Properties
186217
is 0x202A.uniprop('Bidi_Class'), 'LRE', "0x202A.uniprop('Bidi_Class') returns LRE";

0 commit comments

Comments
 (0)