In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/1b474ee3fedd2cefdaafdda6e060b8036ca756df?hp=c7056edeeaf89b005f3208bdca4c2abea3db3639>

- Log -----------------------------------------------------------------
commit 1b474ee3fedd2cefdaafdda6e060b8036ca756df
Author: Nicholas Clark <[email protected]>
Date:   Sun Mar 13 16:42:50 2011 +0000

    Move t/re/reg_unsafe.t's test to a fresh_perl_is() inside pat_advanced.t
    
    Add a passing variant which mentions $&. Note the bug number (#86042) in the
    TODO test.
-----------------------------------------------------------------------

Summary of changes:
 MANIFEST            |    1 -
 t/re/pat_advanced.t |   16 ++++++++++++++++
 t/re/reg_unsafe.t   |   19 -------------------
 3 files changed, 16 insertions(+), 20 deletions(-)
 delete mode 100644 t/re/reg_unsafe.t

diff --git a/MANIFEST b/MANIFEST
index 06e0206..ad3a116 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5053,7 +5053,6 @@ t/re/reg_namedcapture.t           Make sure glob 
assignment doesn't break named capture
 t/re/reg_nc_tie.t              Test the tied methods of Tie::Hash::NamedCapture
 t/re/reg_pmod.t                        See if regexp /p modifier works as 
expected
 t/re/reg_posixcc.t             See if posix character classes behave 
consistently
-t/re/reg_unsafe.t              Check for unsafe match vars
 t/re/re_tests                  Regular expressions for regexp.t
 t/re/rxcode.t                  See if /(?{ code })/ works
 t/re/subst_amp.t               See if $&-related substitution works
diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
index 3e7390d..f9b91fb 100644
--- a/t/re/pat_advanced.t
+++ b/t/re/pat_advanced.t
@@ -1657,6 +1657,22 @@ sub run_tests {
         ($_ = 'abc') =~ /(abc)/g;
         $_ = '123';
         is("$1", 'abc', "/g leads to unsafe match vars: $1");
+
+        fresh_perl_is(<<'EOP', ">abc<\n", {}, 'mention $&');
+$&;
+my $x; 
+($x='abc')=~/(abc)/g; 
+$x='123'; 
+print ">$1<\n";
+EOP
+
+        local $::TODO = 'RT #86042';
+        fresh_perl_is(<<'EOP', ">abc<\n", {}, 'no mention of $&');
+my $x; 
+($x='abc')=~/(abc)/g; 
+$x='123'; 
+print ">$1<\n";
+EOP
     }
 
     {
diff --git a/t/re/reg_unsafe.t b/t/re/reg_unsafe.t
deleted file mode 100644
index 49c7011..0000000
--- a/t/re/reg_unsafe.t
+++ /dev/null
@@ -1,19 +0,0 @@
-#!./perl
-
-BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
-    
-}
-print "1..1\n";
-
-# there is an equivalent test in t/re/pat.t which does NOT fail
-# its not clear why it doesn't fail, so this todo gets its own test
-# file until we can work it out.
-
-my $x; 
-($x='abc')=~/(abc)/g; 
-$x='123'; 
-
-print "not " if $1 ne 'abc';
-print "ok 1 # TODO safe match vars make /g slow\n";

--
Perl5 Master Repository

Reply via email to