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