X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fwarnings.t;h=903837eb0eccc26f863791c544ddc61fb35022a5;hb=727cd2c0d63510e3f59d936e5cb79b8c10fb4dcb;hp=5d23e0da5befb83f5683ddb3b176adf36c381965;hpb=874177a3c7d7d3628958c65e86baad8aad1d3d26;p=p5sagit%2FClass-Accessor-Grouped.git diff --git a/t/warnings.t b/t/warnings.t index 5d23e0d..903837e 100644 --- a/t/warnings.t +++ b/t/warnings.t @@ -1,51 +1,50 @@ -#!perl -wT -# $Id$ use strict; use warnings; BEGIN { - use lib 't/lib'; - use Test::More; - use File::Find; - use File::Basename; + use lib 't/lib'; + use Test::More; + use File::Find; + use File::Basename; - plan skip_all => 'set TEST_AUTHOR to enable this test' unless $ENV{TEST_AUTHOR}; + plan skip_all => 'set TEST_AUTHOR to enable this test' unless $ENV{TEST_AUTHOR}; - eval 'use Test::Strict 0.05'; - plan skip_all => 'Test::Strict 0.05 not installed' if $@; - plan skip_all => 'Need untaint in newer File::Find' if $] <= 5.006; + eval 'use Test::Strict 0.05'; + plan skip_all => 'Test::Strict 0.05 not installed' if $@; + plan skip_all => 'Need untaint in newer File::Find' if $] <= 5.006; }; ## I hope this can go away if Test::Strict or File::Find::Rule ## finally run under -T. Until then, I'm on my own here. ;-) my @files; my %trusted = ( - 'NotReallyAClass.pm' => 1 + 'NotReallyAClass.pm' => 1 ); -find({ wanted => \&wanted, - untaint => 1, - untaint_pattern => qr|^([-+@\w./]+)$|, - untaint_skip => 1, - no_chdir => 1 +find({ + wanted => \&wanted, + untaint => 1, + untaint_pattern => qr|^([-+@\w./]+)$|, + untaint_skip => 1, + no_chdir => 1 }, qw(lib t)); sub wanted { - my $name = $File::Find::name; - my $file = fileparse($name); + my $name = $File::Find::name; + my $file = fileparse($name); - return if $name =~ /TestApp/; + return if $name =~ /TestApp/; - if ($name =~ /\.(pm|pl|t)$/i && !exists($trusted{$file})) { - push @files, $name; - }; + if ($name =~ /\.(pm|pl|t)$/i && !exists($trusted{$file})) { + push @files, $name; + }; }; if (scalar @files) { - plan tests => scalar @files; + plan tests => scalar @files; } else { - plan tests => 1; - fail 'No perl files found for Test::Strict checks!'; + plan tests => 1; + fail 'No perl files found for Test::Strict checks!'; }; foreach (@files) {