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