Commit | Line | Data |
---|---|---|
f4a2945e JH |
1 | #!./perl -T |
2 | ||
3 | BEGIN { | |
4 | chdir 't' if -d 't'; | |
5 | @INC = '../lib'; | |
6b05f64e PP |
6 | require Config; import Config; |
7 | if ($Config{extensions} !~ /\bList\/Util\b/) { | |
8 | print "1..0 # Skip: List::Util was not built\n"; | |
9 | exit 0; | |
10 | } | |
f4a2945e JH |
11 | } |
12 | ||
13 | use lib qw(blib/lib blib/arch); | |
14 | use Scalar::Util qw(tainted); | |
15 | use Config; | |
16 | ||
17 | print "1..5\n"; | |
18 | ||
19 | print "not " if tainted(1); | |
20 | print "ok 1\n"; | |
21 | ||
22 | my $var = 2; | |
23 | ||
24 | print "not " if tainted($var); | |
25 | print "ok 2\n"; | |
26 | ||
27 | my $key = (keys %ENV)[0]; | |
28 | ||
29 | $var = $ENV{$key}; | |
30 | ||
31 | print "not " unless tainted($var); | |
32 | print "ok 3\n"; | |
33 | ||
34 | print "not " unless tainted($ENV{$key}); | |
35 | print "ok 4\n"; | |
36 | ||
37 | print "not " if @ARGV and not tainted($ARGV[0]); | |
38 | print "ok 5\n"; |