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
CommitLineData
6a724e38
AT
1#!./perl -Tw
2# [perl #33173] shellwords.pl and tainting
3
33954ec3
CBW
4BEGIN {
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
6a724e38
AT
15use Text::ParseWords qw(shellwords old_shellwords);
16use Scalar::Util qw(tainted);
17
18print "1..2\n";
19
20print "not " if grep { not tainted($_) } shellwords("$0$^X");
21print "ok 1\n";
22
23print "not " if grep { not tainted($_) } old_shellwords("$0$^X");
24print "ok 2\n";