diff options
Diffstat (limited to 't')
-rw-r--r-- | t/re/pat.t | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/t/re/pat.t b/t/re/pat.t index d8315c4276..d5e5d2fd4a 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -23,7 +23,7 @@ BEGIN { skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader; skip_all_without_unicode_tables(); -plan tests => 834; # Update this when adding/deleting tests. +plan tests => 835; # Update this when adding/deleting tests. run_tests() unless caller; @@ -1887,6 +1887,20 @@ EOF_CODE is($target =~ $re, $result, "[perl #130522] with target '$disp'"); } } + { + # [perl #129377] backref to an unmatched capture should not cause + # reading before start of string. + SKIP: { + skip "no re-debug under miniperl" if is_miniperl; + my $prog = <<'EOP'; +use re qw(Debug EXECUTE); +"x" =~ m{ () y | () \1 }x; +EOP + fresh_perl_like($prog, qr{ + \A (?! .* ^ \s+ - ) + }msx, { stderr => 1 }, "Offsets in debug output are not negative"); + } + } } # End of sub run_tests 1; |