On Tue, 2004-12-28 at 22:29 +0300, Alexey Tourbin wrote: > --- perl-5.9.2.23688/lib/Text/ParseWords/taint.t- 2004-12-28 21:21:26 +0300 > +++ perl-5.9.2.23688/lib/Text/ParseWords/taint.t 2004-12-28 21:39:56 +0300 > @@ -0,0 +1,23 @@ > +#!./perl -Tw > +# [perl #33173] shellwords.pl and tainting > + > +BEGIN { > + chdir 't' if -d 't'; > + @INC = '../lib'; > + require Config; > + if ($Config::Config{extensions} !~ /\bList\/Util\b/) { > + print "1..0 # Skip: Scalar::Util was not built\n"; > + exit 0; > + } > +} > + > +use Text::ParseWords qw(shellwords old_shellwords); > +use Scalar::Util qw(tainted); > + > +print "1..2\n"; > + > +print "not " if grep { not tainted($_) } shellwords("$0$^X"); > +print "ok 1\n"; > + > +print "not " if grep { not tainted($_) } old_shellwords("$0$^X"); > +print "ok 2\n"; This being a module, it's okay to use at least test.pl here, if not Test::More. It should have test comments either way. -- cThread Previous | Thread Next