X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-UUIDColumns.git;a=blobdiff_plain;f=t%2Fstrict.t;h=48cbe3fb59001adb58ac93596cd5af6d71540bf3;hp=95247401558c9a8cf92bef017f77d38bf4496f90;hb=a19bdae0cbe2f9a611586184d84521aee987ac77;hpb=3469b2435b72e296830195a12e2b3e1bc5b3cc9d diff --git a/t/strict.t b/t/strict.t index 9524740..48cbe3f 100644 --- a/t/strict.t +++ b/t/strict.t @@ -1,53 +1,53 @@ -#!perl -wT -# $Id: strict.t 3236 2007-05-05 16:24:35Z claco $ -use strict; -use warnings; - -BEGIN { - use lib 't/lib'; - use DBIC::Test; - use File::Find; - use File::Basename; - - plan skip_all => 'set TEST_AUTHOR to enable this test' unless $ENV{TEST_AUTHOR}; - - eval 'use Test::Strict'; - plan skip_all => 'Test::Strict 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 = ( - -); - -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); - - return if $name =~ /TestApp/; - - if ($name =~ /\.(pm|pl|t)$/i && !exists($trusted{$file})) { - push @files, $name; - }; -}; - -if (scalar @files) { - plan tests => scalar @files; -} else { - plan tests => 1; - fail 'No perl files found for Test::Strict checks!'; -}; - -foreach (@files) { - strict_ok($_); -}; +#!perl -wT +# $Id$ +use strict; +use warnings; + +BEGIN { + use lib 't/lib'; + use DBIC::Test; + use File::Find; + use File::Basename; + + plan skip_all => 'set TEST_AUTHOR to enable this test' unless $ENV{TEST_AUTHOR}; + + eval 'use Test::Strict'; + plan skip_all => 'Test::Strict 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 = ( + +); + +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); + + return if $name =~ /TestApp/; + + if ($name =~ /\.(pm|pl|t)$/i && !exists($trusted{$file})) { + push @files, $name; + }; +}; + +if (scalar @files) { + plan tests => scalar @files; +} else { + plan tests => 1; + fail 'No perl files found for Test::Strict checks!'; +}; + +foreach (@files) { + strict_ok($_); +};