[PATCH #2] Re: [perl #22181] goto undefines my() variables
[p5sagit/p5-mst-13.2.git] / ext / B / t / lint.t
index f4209de..3c71bdc 100644 (file)
@@ -6,7 +6,7 @@ BEGIN {
     require './test.pl';
 }
 
-plan tests => 13;
+plan tests => 15; # adjust also number of skipped tests !
 
 # Runs a separate perl interpreter with the appropriate lint options
 # turned on
@@ -37,45 +37,54 @@ runlint 'implicit-write', 's/foo/bar/', <<'RESULT';
 Implicit substitution on $_ at -e line 1
 RESULT
 
-runlint 'implicit-read', '1 for @ARGV', <<'RESULT', 'implicit-read in foreach';
+SKIP : {
+
+    use Config;
+    skip("Doesn't work with threaded perls",11)
+       if $Config{useithreads};
+
+    runlint 'implicit-read', '1 for @ARGV', <<'RESULT', 'implicit-read in foreach';
 Implicit use of $_ in foreach at -e line 1
 RESULT
 
-runlint 'dollar-underscore', '$_ = 1', <<'RESULT';
+    runlint 'dollar-underscore', '$_ = 1', <<'RESULT';
 Use of $_ at -e line 1
 RESULT
 
-runlint 'dollar-underscore', 'print', <<'RESULT', 'dollar-underscore in print';
+    runlint 'dollar-underscore', 'print', <<'RESULT', 'dollar-underscore in print';
 Use of $_ at -e line 1
 RESULT
 
-runlint 'private-names', 'sub A::_f{};A::_f()', <<'RESULT';
+    runlint 'private-names', 'sub A::_f{};A::_f()', <<'RESULT';
 Illegal reference to private name _f at -e line 1
 RESULT
 
-runlint 'private-names', '$A::_x', <<'RESULT';
+    runlint 'private-names', '$A::_x', <<'RESULT';
 Illegal reference to private name _x at -e line 1
 RESULT
 
-{
-    local $TODO = q/doesn't catch methods/;
     runlint 'private-names', 'sub A::_f{};A->_f()', <<'RESULT',
 Illegal reference to private method name _f at -e line 1
 RESULT
-    'private-names';
-}
+    'private-names (method)';
 
-runlint 'undefined-subs', 'foo()', <<'RESULT';
+    runlint 'undefined-subs', 'foo()', <<'RESULT';
 Undefined subroutine foo called at -e line 1
 RESULT
 
-runlint 'regexp-variables', 'print $&', <<'RESULT';
+    runlint 'regexp-variables', 'print $&', <<'RESULT';
 Use of regexp variable $& at -e line 1
 RESULT
 
-{
-    local $TODO = 'bug';
     runlint 'regexp-variables', 's/./$&/', <<'RESULT';
 Use of regexp variable $& at -e line 1
 RESULT
+
+    runlint 'bare-subs', 'sub bare(){1};$x=bare', '';
+
+    runlint 'bare-subs', 'sub bare(){1}; $x=[bare=>0]; $x=$y{bare}', <<'RESULT';
+Bare sub name 'bare' interpreted as string at -e line 1
+Bare sub name 'bare' interpreted as string at -e line 1
+RESULT
+
 }