Skip to content

Commit fe2c47b

Browse files
committed
test method forms of uni functions
1 parent 347b68e commit fe2c47b

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

β€ŽS15-unicode-information/unimatch-general.t

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

33
use Test;
44

5-
plan 209;
5+
plan 217;
66

77
#use unicode :v(6.3)
88

@@ -20,6 +20,16 @@ nok unimatch(0x3a, 'Nd'), "0x3a is not Nd";
2020
ok unimatch('β…“', 'No'), "'β…“' is No";
2121
nok unimatch('β…“', 'Nd'), "'β…“' is not Nd";
2222

23+
nok 0x29.uniname('Nd'), "0x29 is not Nd";
24+
ok 0x30.uniname('Nd'), "0x30 is Nd";
25+
ok '0'.uniname('Nd'), "'0' is Nd";
26+
ok 0x39.uniname('Nd'), "0x39 is Nd";
27+
ok '9'.uniname('Nd'), "'9' is Nd";
28+
nok 0x3a.uniname('Nd'), "0x3a is not Nd";
29+
30+
ok 'β…“'.uniname('No'), "'β…“' is No";
31+
nok 'β…“'.uniname('Nd'), "'β…“' is not Nd";
32+
2333
ok unimatch("\c[AEGEAN NUMBER NINETY THOUSAND]", 'No'), "AEGEAN NUMBER NINETY THOUSAND is No";
2434
ok unimatch("\c[MATHEMATICAL MONOSPACE DIGIT ZERO]", 'Nd'), "MATHEMATICAL MONOSPACE DIGIT ZERO is Nd";
2535

β€ŽS15-unicode-information/uniname.t

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ use v6;
22

33
use Test;
44

5-
plan 24;
5+
plan 26;
66

77
# Unicode version pragma not needed here, as names cannot change.
88

99
# L<S15/Character Name>
1010

11+
# method forms
12+
#?niecza 2 skip "uniname NYI"
13+
is 0x30.uniname, "DIGIT ZERO", "method uniname returns a name";
14+
is "0".uniname, "DIGIT ZERO", "method uniname works in string form";
15+
1116
#?niecza 24 skip "uniname NYI"
1217

1318
is uniname(0x30), "DIGIT ZERO", "uniname returns a name";
@@ -43,5 +48,6 @@ is uniname("ΒΆ", :either :one), "PARAGRAPH SIGN", "uniname(:eithe
4348
is uniname("\x[2028]", :either :one), "LINE SEPARATOR", "uniname(:either :one) returns current Unicode name for formatting character.";
4449
is uniname("\x[80]", :either :one), "<control-0080>", "uniname(:either :one) returns codepoint label for control character without any name.";
4550

46-
#?rakudo skip "uninames NYI"
51+
#?rakudo 2 skip "uninames NYI"
4752
is uninames("AB"), ("LATIN CAPITAL LETTER A", "LATIN CAPITAL LETTER B"), "uninames correctly works on every character";
53+
is "AB".uninames, ("LATIN CAPITAL LETTER A", "LATIN CAPITAL LETTER B"), "uninames correctly works on every character";

β€ŽS15-unicode-information/unival.t

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

33
use Test;
44

5-
plan 25;
5+
plan 32;
66

77
#use unicode :v(6.3);
88

@@ -19,6 +19,15 @@ is unival('9'), 9, "'9' has numeric value 9";
1919
is unival('β…“').WHAT.gist, '(Rat)', "'β…“' is a Rat";
2020
is unival('β…“'), 1/3, "'β…“' has the value 1/3";
2121

22+
is 0x30.unival.WHAT.gist, '(Int)', "0x30 is Int";
23+
is 0x30.unival, 0, "0x30 has numeric value 0";
24+
is '0'.unival, 0, "'0' has numeric value 0";
25+
is 0x39.unival, 9, "0x39 has numeric value 9";
26+
is '9'.unival, 9, "'9' has numeric value 9";
27+
28+
is 'β…“'.unival.WHAT.gist, '(Rat)', "'β…“' is a Rat";
29+
is 'β…“'.unival, 1/3, "'β…“' has the value 1/3";
30+
2231
is unival("\c[VULGAR FRACTION ONE TENTH]").WHAT.gist, '(Rat)', "'β…’' is a Rat";
2332
is unival('β…’'), 1/10, "'β…’' has the value 1/10";
2433

0 commit comments

Comments
Β (0)