Browse files

add a test for RT #65308; fudge capturing-contexts.t for rakudo

  • Loading branch information...
1 parent 8e96ed1 commit 6fba9029f9cdc233d9ac69146764cb6c2acd91fd @moritz moritz committed Sep 30, 2011
Showing with 15 additions and 2 deletions.
  1. +9 −1 S02-types/subset.t
  2. +6 −1 S05-match/capturing-contexts.t
View
10 S02-types/subset.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 41;
+plan 42;
=begin description
@@ -176,4 +176,12 @@ lives_ok { my Bug::RT80930 $rt80930 }, 'subset with "::" in the name';
}
+# RT #65308
+{
+ subset FooStr of Str where /^foo/;
+ multi method uc(FooStr $self:) { return "OH HAI" };
+ is "foo".uc, 'FOO', 'multi method with subset invocants do not magically find their way into the method dispatch';
+
+}
+
# vim: ft=perl6
View
7 S05-match/capturing-contexts.t
@@ -52,7 +52,7 @@ plan 36;
"foo" ~~ /f<o=&o>+/;
is ~$<o>, 'o o', 'match list stringifies like a normal list';
- isa_ok $<o>, List;
+ ok $<o> ~~ Positional, '... and it is Positional';
# I don't know what difference 'isa' makes, but it does.
# Note that calling .WHAT (as in the original ticket) does not have
# the same effect.
@@ -66,6 +66,7 @@ plan 36;
is $/[0][1], 'b', 'match element [0][1] from /(.)+/';
my @match = @( 'ab' ~~ /(.)+/ );
+ #?rakudo 2 todo 'nom regression'
is @match[0][0], 'a', 'match element [0][0] from /(.)+/ coerced';
is @match[0][1], 'b', 'match element [0][1] from /(.)+/ coerced';
}
@@ -105,6 +106,7 @@ is_run( q{'aa' ~~ /(.)$1/},
}
# RT #71362
+#?rakudo skip 'binding to $/'
{
$/ := 'foobar';
is $0, 'foobar', '$0 works like $/[0], even for non-Match objects';
@@ -116,6 +118,7 @@ is_run( q{'aa' ~~ /(.)$1/},
$/ = Any;
lives_ok { $0 },
'$0 accessible when $/ is undefined';
+ #?rakudo todo 'RT 72956'
ok $0 === Any,
'$0 is Any when $/ is undefined';
nok $0.defined, '$0 is undefined';
@@ -126,11 +129,13 @@ is_run( q{'aa' ~~ /(.)$1/},
ok 'abc' ~~ /(.)+/, 'regex sanity';
my $x = 0;
$x++ for $/.list;
+ #?rakudo todo 'nom regression'
is $x, 1, '$/.list does not flatten quantified subcaptures';
ok 'abc' ~~ /(.)**2 (.)/, 'regex sanity';
$x = 0;
$x++ for $/.list;
+ #?rakudo todo 'nom regression'
is $x, 2, '$/.list does not flattens subcaptures';
}

0 comments on commit 6fba902

Please sign in to comment.