diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2001-11-10 01:10:45 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-10 01:39:01 +0000 |
commit | d11311f770fa80ec2f800e1e2c3dae1c890fdd03 (patch) | |
tree | be8337717ed5ce14588765d110baeff908e0f8e8 /t/run | |
parent | e9b6bb1c03707a0530be2791cdf7c3ef8ec39e07 (diff) | |
download | perl-d11311f770fa80ec2f800e1e2c3dae1c890fdd03.tar.gz |
new tests for swiches -n -p -a -F
Message-ID: <20011110001045.A11945@rafael>
p4raw-id: //depot/perl@12923
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/noswitch.t | 12 | ||||
-rw-r--r-- | t/run/switchF.t | 11 | ||||
-rw-r--r-- | t/run/switcha.t | 12 | ||||
-rw-r--r-- | t/run/switchn.t | 11 | ||||
-rw-r--r-- | t/run/switchp.t | 10 |
5 files changed, 56 insertions, 0 deletions
diff --git a/t/run/noswitch.t b/t/run/noswitch.t new file mode 100644 index 0000000000..a902c1fff7 --- /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 0000000000..a6e9031d0c --- /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 0000000000..ec2f0ccc06 --- /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 0000000000..12d3898a8e --- /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 0000000000..19947356d9 --- /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 |