Skip to content

Commit

Permalink
[JVM] Unfudge/Update some Unicode relates tests
Browse files Browse the repository at this point in the history
(after bumping Java version)
  • Loading branch information
usev6 committed May 16, 2019
1 parent f24ffc4 commit b5c4ed2
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 25 deletions.
2 changes: 1 addition & 1 deletion S02-types/mix.t
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ subtest '.hash does not cause keys to be stringified' => {
}

# RT #131855
#?rakudo.jvm skip 'parsing issue (unicode related)'
#?rakudo.jvm todo 'got: Nil'
{
is-deeply (a => ½).Mix .roll, 'a', 'Mix.roll with fractional weights';
is-deeply (a => ½).MixHash.roll, 'a', 'MixHash.roll with fractional weights';
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/misc.t
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ is (2 Z 3), @z, 'joining of single items';

is 2 × 3, 6, "we have infix MULTIPLICATION SIGN";

#?rakudo.jvm skip 'Bogus term'
#?rakudo.jvm todo 'expected: 0, got: 0.666667'
is 2 ÷ 3, ⅔, "we have infix DIVISION SIGN";

ok 423, 'we have infix LESS-THAN OR EQUAL TO';
Expand Down
7 changes: 0 additions & 7 deletions S05-mass/charsets.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,9 @@ plan 17;
#?rakudo.jvm todo 'Unicode 6.3 -- lower characters'
is $latin-chars.comb(/<lower>/).join, "abcdefghijklmnopqrstuvwxyzµßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ", 'lower chars';

#++ FLAPPERS on jvm
# unicode 6.1 reclassifies § and ¶ as punctuation characters, so actual results may vary depending
# on unicode version bundled with jdk, icu etc.

# failing on Java < 8 (requires unicode 6.1)
is $latin-chars.comb(/<punct>/).join, q<!"#%&'()*,-./:;?@[\]_{}¡§«¶·»¿>, 'punct chars since unicode 6.1';

# failing on Java < 8 (requires unicode 6.1)
is $latin-chars.comb(/<:Punctuation>/).join, q<!"#%&'()*,-./:;?@[\]_{}¡§«¶·»¿>, ':Punctuation chars since unicode 6.1';
#-- FLAPPERS

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

Expand Down
4 changes: 1 addition & 3 deletions S05-mass/properties-general.t
Original file line number Diff line number Diff line change
Expand Up @@ -722,14 +722,12 @@ ok("\x[345B]\c[EXCLAMATION MARK]\c[PARAGRAPH SEPARATOR]" ~~ m/<:ParagraphSeparat
# C Other

# RT124863
#?rakudo.jvm 3 todo "Unions of properties of non-existent codepoints RT #124863"
ok("\x[FFFE]" ~~ m/^<:C>$/, q{Match <C> (Other)} );
ok(!( "\x[FFFE]" ~~ m/^<:!C>$/ ), q{Don't match negated <:C> (Other)} );
ok(!( "\x[FFFE]" ~~ m/^<-:C>$/ ), q{Don't match inverted <:C> (Other)} );
ok(!( "\x[6A3F]" ~~ m/^<:C>$/ ), q{Don't match unrelated <:C> (Other)} );
ok("\x[6A3F]" ~~ m/^<:!C>$/, q{Match unrelated negated <:C> (Other)} );
ok("\x[6A3F]" ~~ m/^<-:C>$/, q{Match unrelated inverted <:C> (Other)} );
#?rakudo.jvm todo "Unions of properties of non-existent codepoints RT #124863"
ok("\x[6A3F]\x[FFFE]" ~~ m/<:C>/, q{Match unanchored <:C> (Other)} );
ok "\x[FFFE]" ~~ /<:Cn>/, "Match unanchored <:Cn> for noncharacters";
ok "\x[1FFFE]" ~~ /<:Cn>/, "Match unanchored <:Cn> for noncharacters";
Expand Down Expand Up @@ -808,7 +806,7 @@ ok("\c[DEVANAGARI VOWEL SIGN AU]\c[SYRIAC ABBREVIATION MARK]" ~~ m/<:Format>/, q
{
my $ascii-chars = [~] chr(0)..chr(0x7F);
my $latin-chars = [~] chr(0)..chr(0xFF);
#?rakudo.jvm skip 'PatternSyntaxException: Unknown character block name {ASCII}'
#?rakudo.jvm skip 'PatternSyntaxException: Unknown character property name {In/IsInASCII} near index 10'
is $ascii-chars.comb(/<:InASCII>+/).join(""), $ascii-chars, 'ascii chars';

is 'abc' ~~ /<:alpha>+/, 'abc', 'alpha chars';
Expand Down
1 change: 0 additions & 1 deletion S15-unicode-information/uniname.t
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ is uniname(0x210000), '<unassigned>', "uniname too high returns <unassigned> (2)
is uninames("AB"), ("LATIN CAPITAL LETTER A", "LATIN CAPITAL LETTER B"), "uninames correctly works on every character";
is "AB".uninames, ("LATIN CAPITAL LETTER A", "LATIN CAPITAL LETTER B"), "uninames correctly works on every character";

#?rakudo.jvm skip "No Unicode 9 yet"
is uniname("🦋"), "BUTTERFLY", "Can resolve Unicode 9 character name";

#?rakudo.jvm todo "HANGUL SYLLABLES D4DB"
Expand Down
1 change: 0 additions & 1 deletion S29-conversions/ord_and_chr.t
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ dies-ok {chr(-1)}, "chr out of range (negative)";

ok !defined(ord("")), 'ord("") returns an undefined value';

#?rakudo.jvm skip 'high character name lookup RT #124838'
is "\c[DROMEDARY CAMEL]".ord, 0x1F42A, "ord of named high character";
is chr(0x1F42A).ord, 0x1F42A, "chr > ord round trip of high character";

Expand Down
6 changes: 1 addition & 5 deletions S32-list/pick.t
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,14 @@ nok ([==] (^2**64).roll(10).map(* +& 15)), 'Range.pick has enough entropy';
}

# RT #132246
#?rakudo.jvm skip 'Problem with ½: Missing required term after infix, Unicode related'
#?DOES 1
{
subtest '.pick on object Hashes' => {
subtest '.pick on object Hashes' => {
plan 2;
my %obj{Any} = question => 42;
is-deeply %obj.pick, %obj.pairs.pick, 'single-Pair Hash';

my %h := :{ :42foo, (True) => False, 42e0 => ½ };
is-deeply gather { %h.pick.take xx 300 }.unique.sort,
(:42foo, (True) => False, 42e0 => ½).sort, 'many Pairs';
}
}


Expand Down
6 changes: 1 addition & 5 deletions S32-list/roll.t
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,14 @@ ok ('a' .. 'z').roll ~~ /\w/, 'Str-Range roll';
}

# RT #132246
#?rakudo.jvm skip 'Problem with ½: Missing required term after infix, Unicode related'
#?DOES 1
{
subtest '.pick on object Hashes' => {
subtest '.pick on object Hashes' => {
plan 2;
my %obj{Any} = question => 42;
is-deeply %obj.pick, %obj.pairs.pick, 'single-Pair Hash';

my %h := :{ :42foo, (True) => False, 42e0 => ½ };
is-deeply gather { %h.pick.take xx 300 }.unique.sort,
(:42foo, (True) => False, 42e0 => ½).sort, 'many Pairs';
}
}

# vim: ft=perl6
2 changes: 1 addition & 1 deletion S32-num/power.t
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ is-deeply 1e0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 1e0, " 1e0⁴
is-deeply (-1)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴, 1, "(-1)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴ == 1";
is-deeply (-1)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, -1, "(-1)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == -1";

#?rakudo.jvm 6 skip 'parsing issue on JVM: Missing required term after infix'
#?rakudo.jvm 6 todo 'got: 1'
is-approx(4 ** ½, 2, "4 ** ½ == 2");
is-approx(4 ** -½, ½, "4 ** -½ == ½");
is-approx(27 ** ⅓, 3, "27 ** ⅓ == 3");
Expand Down

0 comments on commit b5c4ed2

Please sign in to comment.