Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Unfudge tests for JVM RT #126679, psch++
  • Loading branch information
usev6 committed Nov 21, 2015
1 parent 4a5edf7 commit 0dd18f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion S05-substitution/subst.t
Expand Up @@ -217,9 +217,9 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';

# L<S05/Modifiers/The :s modifier is considered sufficiently important>
#?niecza skip "Action method quote:ss not yet implemented"
# also RT #126679
{
$_ = "a\nb\tc d";
#?rakudo.jvm 2 skip 'Cannot access a native attribute as a reference attribute, RT #126679'
ok ss/a b c d/w x y z/, 'successful substitution returns truthy';
# RT #120526
is $_, "w\nx\ty z", 'ss/.../.../ preserves whitespace';
Expand Down
4 changes: 2 additions & 2 deletions S32-str/split-simple.t
Expand Up @@ -88,15 +88,15 @@ ok (''.split('')).elems == 0, q{''.split('') returns empty list};
ok (split('', '')).elems == 0, q{''.split('') returns empty list};

# split with :all should return capture
#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
# also RT #126679
{
my @split = 'abc def ghi'.split(/(\s+)/, :all);
ok @split.elems == 5, q{split returns captured delimiter} ;
ok @split[1] eq ' ', q{split captured single space};
ok @split[3] eq ' ', q{split captured multiple spaces};
}

#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
# also RT #126679
{
my @split = split(/\d+/, 'a4b5', :all);
is @split.elems, 5, 'split() with :all and trailing delimiter (count)';
Expand Down
24 changes: 4 additions & 20 deletions S32-str/split.t
Expand Up @@ -151,8 +151,6 @@ test( "abcde","",3,"empty string",
<a bcde>, # rlpse
);

#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
#?DOES 1
test( "abcd",/./,3,"any character",
<<"" "" "" "" "">>, # r
<<"" a "" b "" c "" d "">>, # rv
Expand All @@ -177,8 +175,6 @@ test( "abcd",/./,3,"any character",
(0=>"a",0=>"b","cd"), # rlpse
);

#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
#?DOES 3
test( "aaaa",$_,3,"only chars matching $_.perl()",
<<"" "" "" "" "">>, # r
<<"" a "" a "" a "" a "">>, # rv
Expand All @@ -203,7 +199,7 @@ test( "aaaa",$_,3,"only chars matching $_.perl()",
(0=>"a",0=>"a","aa"), # rlpse
) for "a", /a/, rx:Perl5/a/;

#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 7
test( "foo bar baz",$_,2,$_,
<foo bar baz>, # r
Expand All @@ -229,7 +225,7 @@ test( "foo bar baz",$_,2,$_,
("foo",0=>" ","bar baz"), # rlpse
) for " ", / " " /, / \s /, / \s+ /, rx:Perl5/ /, rx:Perl5/\s/, rx:Perl5/\s+/;

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

#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
#?DOES 2
test( "|foo|bar|baz|zoo",$_,3,$_,
<<"" foo bar baz zoo>>, # r
<<"" | foo | bar | baz | zoo>>, # rv
Expand All @@ -281,7 +275,7 @@ test( "|foo|bar|baz|zoo",$_,3,$_,
(0=>"|","foo",0=>"|","bar|baz|zoo"), # rlpse
) for "|", / \| /;

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

#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
#?rakudo.jvm skip 'UnwindException RT #124279'
#?DOES 7
test( "comma, separated, values",$_,2,$_,
<comma separated values>, # r
Expand Down Expand Up @@ -366,8 +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 'Cannot access a native attribute as a reference attribute, RT #126679'
#?DOES 2
test( "hello world",$_,3,$_,
<<h ll " w" rld>>, # r
<<h e ll o " w" o rld>>, # rv
Expand All @@ -392,7 +384,6 @@ test( "hello world",$_,3,$_,
("h",0=>"e","ll",0=>"o"," world"), # rlpse
) for /<[aeiou]>/, rx:Perl5/[aeiou]/;

#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
{
my @a = "hello world".split(/<[aeiou]>/, :v);
is +@a, 7, "split:v resulted in seven pieces";
Expand All @@ -401,7 +392,6 @@ test( "hello world",$_,3,$_,
isa-ok @a[5], Match, "sixth is a Match object";
}

#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
{
my @a = "hello world".split(/(<[aeiou]>)(.)/, :v);
is +@a, 7, "split:v resulted in seven pieces";
Expand All @@ -412,8 +402,6 @@ test( "hello world",$_,3,$_,
}

# RT #63066
#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
#?DOES 2
test( "hello-world",$_,3,$_,
<<"" hello - world "">>, # r
<<"" "" hello "" - "" world "" "">>, # rv
Expand All @@ -440,8 +428,6 @@ test( "hello-world",$_,3,$_,

# RT #63066
my $p = 0=>"";
#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
#?DOES 1
test( "-a-b-c-",/<.ws>/,4,/<.ws>/,
<<"" - a - b - c - "">>, # r
<<"" "" - "" a "" - "" b "" - "" c "" - "" "">>, # rv
Expand All @@ -467,8 +453,6 @@ test( "-a-b-c-",/<.ws>/,4,/<.ws>/,
);

# RT #63066
#?rakudo.jvm skip 'Cannot access a native attribute as a reference attribute, RT #126679'
#?DOES 1
test( "-a-b-c-",/<.wb>/,4,/<.wb>/,
<- a - b - c ->, # r
<<- "" a "" - "" b "" - "" c "" ->>, # rv
Expand Down

0 comments on commit 0dd18f4

Please sign in to comment.