ESUCCESS = 0 is not true, but exists.
[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     @INC = '../lib';
7 }
8
9 use Cwd;
10 use Test::More tests => 6;
11 use Scalar::Util qw/tainted/;
12
13 my $cwd;
14 eval { $cwd = getcwd; };
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" );
21
22 eval { $cwd = fastcwd; };
23 is( $@, '',             'fastcwd() does not explode under taint mode' );
24 ok( tainted($cwd),      "its return value is tainted" );