AxKit-XSP-Minisession

 view release on metacpan or  search on metacpan

t/005_strict.t  view on Meta::CPAN

# $Id: /local/CPAN/AxKit-XSP-Minisession/t/005_strict.t 1426 2005-03-15T02:46:06.663458Z claco  $
use strict;
use warnings;
use Test::More;
use File::Find;
use File::Basename;

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 = (
    'apache_test_config.pm' => 1,
    'modperl_inc.pl'        => 1,
    'modperl_startup.pl'    => 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);

    if ($name =~ /\.(pm|pl|t)$/i && !exists($trusted{$file})) {
        push @files, $name;
    };

t/006_warnings.t  view on Meta::CPAN

# $Id: /local/CPAN/AxKit-XSP-Minisession/t/006_warnings.t 1428 2005-03-22T00:20:24.343356Z claco  $
use strict;
use warnings;
use Test::More;
use File::Find;
use File::Basename;

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 = (
    'apache_test_config.pm' => 1,
    'modperl_inc.pl'        => 1,
    'modperl_startup.pl'    => 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);

    if ($name =~ /\.(pm|pl|t)$/i && !exists($trusted{$file})) {
        push @files, $name;
    };



( run in 0.250 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )