Upgrade to Pod::LaTeX 0.58
[p5sagit/p5-mst-13.2.git] / ext / Cwd / t / taint.t
CommitLineData
ea715489 1#!./perl -Tw
2# Testing Cwd under taint mode.
3
4BEGIN {
5 chdir 't' if -d 't';
39f7733f 6 if ($ENV{PERL_CORE}) {
7 @INC = '../lib';
8 }
ea715489 9}
39f7733f 10use Cwd;
ea715489 11
3ee63918 12use strict;
3ee63918 13use Test::More tests => 16;
248785eb 14use Scalar::Util qw/tainted/;
ea715489 15
3ee63918 16my @Functions = qw(getcwd cwd fastcwd fastgetcwd
17 abs_path fast_abs_path
18 realpath fast_realpath
19 );
248785eb 20
3ee63918 21foreach my $func (@Functions) {
22 no strict 'refs';
23 my $cwd;
24 eval { $cwd = &{'Cwd::'.$func} };
a9939470 25 is( $@, '', "$func() should not explode under taint mode" );
26 ok( tainted($cwd), "its return value should be tainted" );
3ee63918 27}