2 # Testing Cwd under taint mode.
7 chdir 't' unless $ENV{PERL_CORE};
10 use lib File::Spec->catdir('t', 'lib');
11 use Test::More tests => 17;
13 use Scalar::Util qw/tainted/;
15 my @Functions = qw(getcwd cwd fastcwd fastgetcwd
16 abs_path fast_abs_path
17 realpath fast_realpath
20 foreach my $func (@Functions) {
23 eval { $cwd = &{'Cwd::'.$func} };
24 is( $@, '', "$func() should not explode under taint mode" );
25 ok( tainted($cwd), "its return value should be tainted" );
28 # Previous versions of Cwd tainted $^O
29 is !tainted($^O), 1, "\$^O should not be tainted";