From: Rafael Garcia-Suarez Date: Sat, 10 Nov 2001 00:10:45 +0000 (+0100) Subject: new tests for swiches -n -p -a -F X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d11311f770fa80ec2f800e1e2c3dae1c890fdd03;p=p5sagit%2Fp5-mst-13.2.git new tests for swiches -n -p -a -F Message-ID: <20011110001045.A11945@rafael> p4raw-id: //depot/perl@12923 --- diff --git a/MANIFEST b/MANIFEST index 63b0257..be70662 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2263,6 +2263,11 @@ t/README Instructions for regression tests t/run/exit.t Test perl's exit status. t/run/kill_perl.t Tests that kill perl. t/run/runenv.t Test if perl honors its environment variables. +t/run/noswitch.t Test aliasing ARGV for other switch tests +t/run/switchp.t Test the -p switch +t/run/switchn.t Test the -n switch +t/run/switcha.t Test the -a switch +t/run/switchF.t Test the -F switch t/TEST The regression tester t/test.pl Simple testing library t/TestInit.pm Preamble library for core tests diff --git a/t/run/noswitch.t b/t/run/noswitch.t new file mode 100644 index 0000000..a902c1f --- /dev/null +++ b/t/run/noswitch.t @@ -0,0 +1,12 @@ +#!./perl + +BEGIN { + print "1..3\n"; + *ARGV = *DATA; +} +print "ok 1\n"; +print <>; +print "ok 3\n"; + +__DATA__ +ok 2 - read from aliased DATA filehandle diff --git a/t/run/switchF.t b/t/run/switchF.t new file mode 100644 index 0000000..a6e9031 --- /dev/null +++ b/t/run/switchF.t @@ -0,0 +1,11 @@ +#!./perl -anFx+ + +BEGIN { + print "1..2\n"; + *ARGV = *DATA; +} +print "@F"; + +__DATA__ +okx1 +okxxx2 diff --git a/t/run/switcha.t b/t/run/switcha.t new file mode 100644 index 0000000..ec2f0cc --- /dev/null +++ b/t/run/switcha.t @@ -0,0 +1,12 @@ +#!./perl -na + +BEGIN { + print "1..2\n"; + *ARGV = *DATA; + $i = 0; +} +print "$F[1] ",++$i,"\n"; + +__DATA__ +not ok +not ok 3 diff --git a/t/run/switchn.t b/t/run/switchn.t new file mode 100644 index 0000000..12d3898 --- /dev/null +++ b/t/run/switchn.t @@ -0,0 +1,11 @@ +#!./perl -n + +BEGIN { + print "1..2\n"; + *ARGV = *DATA; +} +print; + +__DATA__ +ok 1 +ok 2 diff --git a/t/run/switchp.t b/t/run/switchp.t new file mode 100644 index 0000000..1994735 --- /dev/null +++ b/t/run/switchp.t @@ -0,0 +1,10 @@ +#!./perl -p + +BEGIN { + print "1..2\n"; + *ARGV = *DATA; +} + +__DATA__ +ok 1 +ok 2