In ReTest.pl's may_not_warn(), eliminate the use of $::Message.
authorNicholas Clark <nick@ccl4.org>
Thu, 3 Mar 2011 14:27:34 +0000 (14:27 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 3 Mar 2011 14:27:34 +0000 (14:27 +0000)
For the one caller using the global variable, instead pass the message in as
a function parameter.

t/re/ReTest.pl
t/re/pat.t

index 0c08e25..ebdbdd3 100644 (file)
@@ -183,9 +183,7 @@ sub may_not_warn {
     local $SIG {__WARN__} = sub {$w .= join "" => @_};
     use warnings 'all';
     ref $code ? &$code : eval $code;
-    _ok !$w, $name // ($Message ? "$Message (did not warn)"
-                                : "Did not warn"),
-             "Got warning '$w'";
+    _ok !$w, $name, "Got warning '$w'";
 }
 
 1;
index bdfff05..e0efb3e 100644 (file)
@@ -984,8 +984,8 @@ sub run_tests {
 
 
     {
-        local $Message = '"1" is not \s';
-        may_not_warn sub {ok ("1\n" x 102) !~ /^\s*\n/m};
+        my $message = '"1" is not \s';
+        may_not_warn sub {ok ("1\n" x 102 !~ /^\s*\n/m, $message)}, "$message (did not warn)";
     }