Skip to content

Commit

Permalink
Use Test::Needs in taint.t
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Mar 16, 2024
1 parent 417ed5a commit 4774800
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions t/taint.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,18 @@

use strict;
use warnings;
use Test::Most;
use Test::Most tests => 7;
use Test::Needs 'Test::Taint';

eval 'use Test::Taint';
if($@) {
plan(skip_all => 'Test::Taint required for testing untainting');
} else {
plan(tests => 7);
Test::Taint->import();
taint_checking_ok();
require_ok('CGI::Info');

taint_checking_ok();
require_ok('CGI::Info');
$ENV{'C_DOCUMENT_ROOT'} = $ENV{'HOME'};
delete $ENV{'DOCUMENT_ROOT'};

$ENV{'C_DOCUMENT_ROOT'} = $ENV{'HOME'};
delete $ENV{'DOCUMENT_ROOT'};

my $i = new_ok('CGI::Info');
untainted_ok($i->tmpdir());
untainted_ok($i->script_name());
untainted_ok($i->tmpdir() . '/' . $i->script_name() . '.foo');
untainted_ok($i->script_path());
}
my $i = new_ok('CGI::Info');
untainted_ok($i->tmpdir());
untainted_ok($i->script_name());
untainted_ok($i->tmpdir() . '/' . $i->script_name() . '.foo');
untainted_ok($i->script_path());

0 comments on commit 4774800

Please sign in to comment.