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