Commit | Line | Data |
ea715489 |
1 | #!./perl -Tw |
2 | # Testing Cwd under taint mode. |
3 | |
4 | BEGIN { |
5 | chdir 't' if -d 't'; |
6 | @INC = '../lib'; |
7 | } |
8 | |
9 | use Cwd; |
248785eb |
10 | use Test::More tests => 6; |
11 | use Scalar::Util qw/tainted/; |
ea715489 |
12 | |
13 | my $cwd; |
14 | eval { $cwd = getcwd; }; |
248785eb |
15 | is( $@, '', 'getcwd() does not explode under taint mode' ); |
16 | ok( tainted($cwd), "its return value is tainted" ); |
17 | |
18 | eval { $cwd = cwd; }; |
19 | is( $@, '', 'cwd() does not explode under taint mode' ); |
20 | ok( tainted($cwd), "its return value is tainted" ); |
ea715489 |
21 | |
248785eb |
22 | eval { $cwd = fastcwd; }; |
23 | is( $@, '', 'fastcwd() does not explode under taint mode' ); |
24 | ok( tainted($cwd), "its return value is tainted" ); |