New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Referring to non-existent captures causes Null PMC Access #1378
Comments
From @moritz16:06 <@moritz_> rakudo: say 'aa' ~~ /(.)$1/; say $0.to $1 doesn't exist, but this is clearly a less-than-awesome error message. |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S05-match/capturing-contexts.t commit a79f9bc01be3c4fec98a41dd8e8c497783bc2ee2 [t/spec] Tests for RT #70007 Inline Patchdiff --git a/t/spec/S05-match/capturing-contexts.t b/t/spec/S05-match/capturing-contexts.t
index a7279ec..b0ef110 100644
--- a/t/spec/S05-match/capturing-contexts.t
+++ b/t/spec/S05-match/capturing-contexts.t
@@ -1,8 +1,8 @@
use v6;
-
use Test;
-
-plan 21;
+BEGIN { @*INC.push('t/spec/packages/') };
+use Test::Util;
+plan *;
if !eval('("a" ~~ /a/)') {
skip_rest "skipped tests - rules support appears to be missing";
@@ -81,4 +81,17 @@ if !eval('("a" ~~ /a/)') {
'Match coerced to Hash says match exists';
}
+#?rakudo skip 'RT 70007'
+nok 'aa' ~~ /(.)$1/, 'match with non-existent capture does not match';
+#?rakudo todo 'RT 70007'
+is_run( q{'aa' ~~ /(.)$1/},
+ {
+ status => 0,
+ out => '',
+ err => rx/\S/,
+ },
+ 'match with non-existent capture emits a warning' );
+
+done_testing;
+
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaI wrote the test based on the discussion that starts here: |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S05-match/capturing-contexts.t commit 44dda9c33b4a3c31e60802a492ffb8ed97ccacde [t/spec] improve tests for RT #70007 Inline Patchdiff --git a/t/spec/S05-match/capturing-contexts.t b/t/spec/S05-match/capturing-contexts.t
index 81683cc..a68e122 100644
--- a/t/spec/S05-match/capturing-contexts.t
+++ b/t/spec/S05-match/capturing-contexts.t
@@ -100,10 +100,10 @@ is_run( q{'aa' ~~ /(.)$1/},
}
# RT #70003
+#?rakudo skip 'RT 70003'
{
- 'a' ~~ /a/;
- #?rakudo skip 'RT 70003'
- is ($/.orig).rindex('a'), 0, 'rindex() works on $/.orig';
+ is ($/.orig).rindex('a'), 1, 'rindex() works on $/.orig';
+ is ($/.orig).rindex('a', 2), 1, 'rindex() works on $/.orig';
}
done_testing; |
From @cokeOn Sun Oct 25 08:08:11 2009, moritz wrote:
14:40 < [Coke]> rakudo: say 'aa' ~~ /(.)$1/; say $0.to I think the tests described later in the ticket were assuming this -- |
From @jnthnOn Mon Oct 03 11:42:07 2011, coke wrote:
It fails to match and so errors as expected now:
Tagging testneeded. Thanks, Jonathan |
From @moritzTested in S05-mass/rx.t. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#70007 (status was 'resolved')
Searchable as RT70007$
The text was updated successfully, but these errors were encountered: