This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Text-ParseWords to CPAN version 3.29
[perl5.git] / cpan / Text-ParseWords / t / taint.t
1 #!./perl -Tw
2 # [perl #33173] shellwords.pl and tainting
3
4 BEGIN {
5     if ( $ENV{PERL_CORE} ) {
6         require Config;
7         no warnings 'once';
8         if ($Config::Config{extensions} !~ /\bList\/Util\b/) {
9             print "1..0 # Skip: Scalar::Util was not built\n";
10             exit 0;
11         }
12     }
13 }
14
15 use Text::ParseWords qw(shellwords old_shellwords);
16 use Scalar::Util qw(tainted);
17
18 print "1..2\n";
19
20 print "not " if grep { not tainted($_) } shellwords("$0$^X");
21 print "ok 1\n";
22
23 print "not " if grep { not tainted($_) } old_shellwords("$0$^X");
24 print "ok 2\n";