Skip to content

Commit

Permalink
Unfudge a lot of tests for rakudo-j
Browse files Browse the repository at this point in the history
All those tests are passing now after lizmat's++
recent work on subst, match et al. (Probably a side
effect, but very nice, nevertheless.)
  • Loading branch information
usev6 committed Oct 25, 2016
1 parent a6f89b6 commit 8d39a9b
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 42 deletions.
3 changes: 0 additions & 3 deletions S05-modifier/counted-match.t
Expand Up @@ -18,7 +18,6 @@ my $data = "f fo foo fooo foooo fooooo foooooo";

#RT #125815
throws-like '$data.match(/fo+/, :nth(0))', Exception, message => rx/nth/;
#?rakudo.jvm 2 todo 'RT #125815'
throws-like '$data.match(/fo+/, :nth(-1))', Exception, message => rx/nth/;
throws-like '$data.match(/fo+/, :nth(-2))', Exception, message => rx/nth/;

Expand Down Expand Up @@ -51,7 +50,6 @@ my $data = "f fo foo fooo foooo fooooo foooooo";

# more interesting variations of :nth(...)
#?niecza skip 'hangs'
#?rakudo.jvm skip 'RT #124279'
{
my @match = $data.match(/fo+/, :nth(2, 3)).list;
is +@match, 2, 'nth(list) is ok';
Expand All @@ -73,7 +71,6 @@ my $data = "f fo foo fooo foooo fooooo foooooo";
is @match, <foo foooo foooooo>, 'nth(infinite sequence) matched correctly';
}

#?rakudo.jvm skip 'RT #124279'
#?niecza skip 'Excess arguments to CORE Cool.match'
{
is 'abecidofug'.match(/<[aeiou]>./, :nth(1,3,5), :x(2)).join('|'),
Expand Down
12 changes: 0 additions & 12 deletions S05-modifier/counted.t
Expand Up @@ -24,7 +24,6 @@ my $sub6 = "f fo foo fooo foooo fooooo bar";

#RT #125815
throws-like '$data ~~ m:nth(0)/fo+/', Exception, message => rx/nth/;
#?rakudo.jvm 2 todo 'RT #125815'
throws-like '$data ~~ m:nth(-1)/fo+/', Exception, message => rx/nth/;
throws-like '$data ~~ m:nth(-Inf)/fo+/', Exception, message => rx/nth/;

Expand Down Expand Up @@ -58,7 +57,6 @@ for (1..6) -> $N {

# more interesting variations of :nth(...)
#?niecza skip 'm:g'
#?rakudo.jvm skip 'RT #124279'
{
ok($data ~~ m:nth(2,3):global/(fo+)/, 'nth(list) is ok');
is(@(), <foo fooo>, 'nth(list) matched correctly');
Expand Down Expand Up @@ -162,13 +160,10 @@ ok(!( $data ~~ m:7th/fo+/ ), 'No match 7th');
my $try = $data;

#RT #125815
#?rakudo.jvm todo 'RT #125815'
throws-like '$try ~~ s:0th{fo+}=q{bar}', Exception, message => rx/nth/;
is($try, $data, 'No change to data for 0th');
#?rakudo.jvm todo 'RT #125815'
throws-like '$try ~~ s:th(-1){fo+}=q{bar}', Exception, message => rx/nth/;
is($try, $data, 'No change to data for :th(-1)');
#?rakudo.jvm todo 'RT #125815'
throws-like '$try ~~ s:th(-Inf){fo+}=q{bar}', Exception, message => rx/nth/;
is($try, $data, 'No change to data for :th(-Inf)');

Expand Down Expand Up @@ -216,7 +211,6 @@ is($/, 'foo', 'Matched value for 3th « <ident>');
# :nth and *-N

is("ABCDE" ~~ m:nth(*)/\w/, "E", "Can match with * index");
#?rakudo.jvm todo "got: 'False', expected: 'D'"
is("ABCDE" ~~ m:nth(*-1)/\w/, "D", "Can match with *-1 index");

$data = "f fo foo fooo foooo fooooo foooooo";
Expand All @@ -235,32 +229,26 @@ $sub6 = "f bar bar bar bar bar bar";
is($try, $data, 'No change to data for 0x');

$try = $data;
#?rakudo.jvm 2 skip 'RT #124279'
ok($try ~~ s:1x{fo+}=q{bar}, 'substitute 1x');
is($try, $sub1, 'substituted 1x correctly');

$try = $data;
#?rakudo.jvm 2 skip 'RT #124279'
ok($try ~~ s:2x{fo+}=q{bar}, 'substitute 2x');
is($try, $sub2, 'substituted 2x correctly');

$try = $data;
#?rakudo.jvm 2 skip 'RT #124279'
ok($try ~~ s:3x{fo+}=q{bar}, 'substitute 3x');
is($try, $sub3, 'substituted 3x correctly');

$try = $data;
#?rakudo.jvm 2 skip 'RT #124279'
ok($try ~~ s:4x{fo+}=q{bar}, 'substitute 4x');
is($try, $sub4, 'substituted 4x correctly');

$try = $data;
#?rakudo.jvm 2 skip 'RT #124279'
ok($try ~~ s:5x{fo+}=q{bar}, 'substitute 5x');
is($try, $sub5, 'substituted 5x correctly');

$try = $data;
#?rakudo.jvm 2 skip 'RT #124279'
ok($try ~~ s:6x{fo+}=q{bar}, 'substitute 6x');
is($try, $sub6, 'substituted 6x correctly');

Expand Down
1 change: 0 additions & 1 deletion S05-modifier/repetition-exhaustive.t
Expand Up @@ -19,7 +19,6 @@ how the C<$/> looks like with the C<:x($count)> modifier.
my $str = "abbb";
my regex rx { a b+ };

#?rakudo.jvm 4 skip 'RT #124279'
ok($str ~~ m:ex:x(2)/<rx>/, "Simple combination of :x(2) and :exhaustive");
#?rakudo todo 'exhaustive capture too greedy RT #125133'
is(~$/[0], "ab", 'First entry of prev. genenerated $/');
Expand Down
4 changes: 0 additions & 4 deletions S05-modifier/repetition.t
Expand Up @@ -5,11 +5,9 @@ plan 12;

#L<S05/Modifiers/"If followed by an x, it means repetition.">

#?rakudo.jvm skip 'RT #124279'
ok('abab' ~~ m:2x/ab/, ':2x (repetition) modifier (+)');
nok('ab' ~~ m:2x/ab/, ':2x (repetition) modifier (-)');

#?rakudo.jvm skip 'RT #124279'
ok('abab' ~~ m:x(2)/ab/, ':2x (repetition) modifier (+)');
nok('ab' ~~ m:x(2)/ab/, ':2x (repetition) modifier (-)');

Expand All @@ -18,14 +16,12 @@ nok('ab' ~~ m:x(2)/ab/, ':2x (repetition) modifier (-)');
nok 'abc'.match(rx/ab/, :x(2)), ':x(2) with .match method (-)';

ok 'ababc'.match(rx/./, :x(3)), ':x(3) with .match method (bool)';
#?rakudo.jvm skip 'RT #124279'
is 'ababc'.match(rx/./, :x(3)).join('|'), 'a|b|a', ':x(3) with .match method (result)';
}

{
ok 'abacad'.match(rx/a./, :x(1..3)), ':x(Range)';
nok 'abcabc'.match(rx/a./, :x(3..4)), ':x(Range) > number of matches';
#?rakudo.jvm skip 'UnwindException RT #124279'
is 'abacadae'.match(rx/a./, :x(1..3)).join('|'), 'ab|ac|ad', ':x(Range) (upper bound)';
is 'abacad'.match(rx/a./, :x(2..5)).join('|'), 'ab|ac|ad', ':x(Range) (takes as much as it can)';
}
Expand Down
9 changes: 0 additions & 9 deletions S05-substitution/subst.t
Expand Up @@ -54,7 +54,6 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
{
is 'a b c d'.subst(/\w/, 'x', :g), 'x x x x', '.subst and :g';
is 'a b c d'.subst(/\w/, 'x', :global), 'x x x x', '.subst and :global';
#?rakudo.jvm 7 skip 'RT #124279'
is 'a b c d'.subst(/\w/, 'x', :x(0)), 'a b c d', '.subst and :x(0)';
is 'a b c d'.subst(/\w/, 'x', :x(1)), 'x b c d', '.subst and :x(1)';
is 'a b c d'.subst(/\w/, 'x', :x(2)), 'x x c d', '.subst and :x(2)';
Expand All @@ -63,7 +62,6 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
is 'a b c d'.subst(/\w/, 'x', :x(5)), 'a b c d', '.subst and :x(5)';
is 'a b c d'.subst(/\w/, 'x', :x(*)), 'x x x x', '.subst and :x(*)';

#?rakudo.jvm 2 skip 'UnwindException RT #124279'
is 'a b c d'.subst(/\w/, 'x', :x(0..1)), 'x b c d', '.subst and :x(0..1)';
is 'a b c d'.subst(/\w/, 'x', :x(1..3)), 'x x x d', '.subst and :x(0..3)';
is 'a b c d'.subst(/\w/, 'x', :x(3..5)), 'x x x x', '.subst and :x(3..5)';
Expand All @@ -73,15 +71,13 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
# string pattern versions
is 'a a a a'.subst('a', 'x', :g), 'x x x x', '.subst (str pattern) and :g';
is 'a a a a'.subst('a', 'x', :x(0)), 'a a a a', '.subst (str pattern) and :x(0)';
#?rakudo.jvm 6 skip 'RT #124279'
is 'a a a a'.subst('a', 'x', :x(1)), 'x a a a', '.subst (str pattern) and :x(1)';
is 'a a a a'.subst('a', 'x', :x(2)), 'x x a a', '.subst (str pattern) and :x(2)';
is 'a a a a'.subst('a', 'x', :x(3)), 'x x x a', '.subst (str pattern) and :x(3)';
is 'a a a a'.subst('a', 'x', :x(4)), 'x x x x', '.subst (str pattern) and :x(4)';
is 'a a a a'.subst('a', 'x', :x(5)), 'a a a a', '.subst (str pattern) and :x(5)';
is 'a a a a'.subst('a', 'x', :x(*)), 'x x x x', '.subst (str pattern) and :x(*)';

#?rakudo.jvm 2 skip 'UnwindException RT #124279'
is 'a a a a'.subst('a', 'x', :x(0..1)), 'x a a a', '.subst (str pattern) and :x(0..1)';
is 'a a a a'.subst('a', 'x', :x(1..3)), 'x x x a', '.subst (str pattern) and :x(0..3)';
is 'a a a a'.subst('a', 'x', :x(3..5)), 'x x x x', '.subst (str pattern) and :x(3..5)';
Expand All @@ -100,7 +96,6 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
is 'a b c d'.subst(/\w/, 'x', :nth(5)), 'a b c d', '.subst and :nth(5)';

# string pattern versions
#?rakudo.jvm todo 'Code does not die'
throws-like '"a a a a".subst("a", "x", :nth(0))', Exception, message => rx/nth/; # RT #125815
is 'a a a a'.subst('a', 'x', :nth(1)), 'x a a a', '.subst (str pattern) and :nth(1)';
is 'a a a a'.subst('a', 'x', :nth(2)), 'a x a a', '.subst (str pattern) and :nth(2)';
Expand All @@ -110,7 +105,6 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
}

# combining :nth with :x
#?rakudo.jvm skip 'RT #124279'
{
is 'a b c d e f g h'.subst(/\w/, 'x', :nth(1,2,3,4), :x(3)),
'x x x d e f g h',
Expand Down Expand Up @@ -184,7 +178,6 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';

# :c and :nth(3, 4)
#?niecza 3 todo ":nth(3, 4) NYI"
#?rakudo.jvm 3 skip 'RT #124279'
is 'a b c d e f g h'.subst(/\w/, 'x', :c(0), :nth(3, 4)),
'a b x x e f g h',
'.subst with :c(0) and :nth(3, 4)';
Expand Down Expand Up @@ -325,7 +318,6 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
is $_, 'aa bb cc', 's:g[...] and captures work together well';
}

#?rakudo.jvm skip 'RT #124279'
{
my $x = 'ABCD';
$x ~~ s:x(2)/<.alpha>/x/;
Expand Down Expand Up @@ -360,7 +352,6 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
}

# s///
#?rakudo.jvm skip 'RT #124279'
{
my $x = 'ooooo';
$x ~~ s:x(2):nth(1,3)/o/A/;
Expand Down
1 change: 0 additions & 1 deletion S32-str/split-simple.t
Expand Up @@ -46,7 +46,6 @@ split_test @('theXbigXbang'.split(/X/, 0)), (), 'Zero limit returns empty List'
}
split_test 'ab1cd12ef'.split(/\d+/, 1), @(<ab1cd12ef>), 'Limit of 1 returns a 1 element List (with identical string)';
split_test '102030405'.split(0, 3), <1 2 30405>, 'Split on an Integer with limit parameter works';
#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 1
split_test(
'<tag>soup</tag>'.split(/\<\/?.*?\>/, 3),
Expand Down
12 changes: 0 additions & 12 deletions S32-str/split.t
Expand Up @@ -151,7 +151,6 @@ test( "abcde","",3,"empty string",
<a bcde>, # rlpse
);

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 1
test( "abcd",/./,3,"any character",
<<"" "" "" "" "">>, # r
Expand All @@ -177,7 +176,6 @@ test( "abcd",/./,3,"any character",
(0=>"a",0=>"b","cd"), # rlpse
);

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 3
test( "aaaa",$_,3,"only chars matching $_.perl()",
<<"" "" "" "" "">>, # r
Expand All @@ -203,7 +201,6 @@ test( "aaaa",$_,3,"only chars matching $_.perl()",
(0=>"a",0=>"a","aa"), # rlpse
) for "a", /a/, rx:Perl5/a/;

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 7
test( "foo bar baz",$_,2,$_,
<foo bar baz>, # r
Expand All @@ -229,7 +226,6 @@ test( "foo bar baz",$_,2,$_,
("foo",0=>" ","bar baz"), # rlpse
) for " ", / " " /, / \s /, / \s+ /, rx:Perl5/ /, rx:Perl5/\s/, rx:Perl5/\s+/;

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 2
test( "thisisit",$_,2,$_,
<thi i it>, # r
Expand All @@ -255,7 +251,6 @@ test( "thisisit",$_,2,$_,
("thi",0=>"s","isit"), # rlpse
) for "s", /s/;

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 2
test( "|foo|bar|baz|zoo",$_,3,$_,
<<"" foo bar baz zoo>>, # r
Expand All @@ -281,7 +276,6 @@ test( "|foo|bar|baz|zoo",$_,3,$_,
(0=>"|","foo",0=>"|","bar|baz|zoo"), # rlpse
) for "|", / \| /;

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 3
test( "foo|bar|baz|zoo|",$_,2,$_,
<<foo bar baz zoo "">>, # r
Expand All @@ -307,7 +301,6 @@ test( "foo|bar|baz|zoo|",$_,2,$_,
("foo",0=>"|","bar|baz|zoo|"), # rlpse
) for "|", / \| /, rx:Perl5/\|/;

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 7
test( "comma, separated, values",$_,2,$_,
<comma separated values>, # r
Expand Down Expand Up @@ -342,7 +335,6 @@ test("","",2,"empty string", |(() xx 20));
test("","foo",2,"empty string", |(() xx 20));
test("zzzzz","a",2,"no match",|(("zzzzz",) xx 20));

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 1
test( "hello world",<a e i o u>,3,<a e i o u>,
<<h ll " w" rld>>, # r
Expand All @@ -368,7 +360,6 @@ test( "hello world",<a e i o u>,3,<a e i o u>,
("h",1=>"e","ll",3=>"o"," world"), # rlpse
);

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 2
test( "hello world",$_,3,$_,
<<h ll " w" rld>>, # r
Expand Down Expand Up @@ -411,7 +402,6 @@ test( "hello world",$_,3,$_,
is @a[3][1], " ", "Fourth capture worked";
}

#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 2
# RT #63066
test( "hello-world",$_,3,$_,
Expand Down Expand Up @@ -440,7 +430,6 @@ test( "hello-world",$_,3,$_,

# RT #63066
my $p = 0=>"";
#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 1
test( "-a-b-c-",/<.ws>/,4,/<.ws>/,
<<"" - a - b - c - "">>, # r
Expand All @@ -467,7 +456,6 @@ test( "-a-b-c-",/<.ws>/,4,/<.ws>/,
);

# RT #63066
#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 1
test( "-a-b-c-",/<.wb>/,4,/<.wb>/,
<- a - b - c ->, # r
Expand Down

0 comments on commit 8d39a9b

Please sign in to comment.