diff options
author | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
commit | fe14fcc35f78a371a174a1d14256c2f35ae4262b (patch) | |
tree | d472cb1055c47b9701cb0840969aacdbdbc9354a /t/io/argv.t | |
parent | 27e2fb84680b9cc1db17238d5bf10b97626f477f (diff) | |
download | perl-fe14fcc35f78a371a174a1d14256c2f35ae4262b.tar.gz |
perl 4.0.00: (no release announcement available)perl-4.0.00
So far, 4.0 is still a beta test version. For the last production
version, look in pub/perl.3.0/kits@44.
Diffstat (limited to 't/io/argv.t')
-rw-r--r-- | t/io/argv.t | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/io/argv.t b/t/io/argv.t new file mode 100644 index 0000000000..6f55896fdf --- /dev/null +++ b/t/io/argv.t @@ -0,0 +1,36 @@ +#!./perl + +# $Header: argv.t,v 4.0 91/03/20 01:50:46 lwall Locked $ + +print "1..5\n"; + +open(try, '>Io.argv.tmp') || (die "Can't open temp file."); +print try "a line\n"; +close try; + +$x = `./perl -e 'while (<>) {print \$.,\$_;}' Io.argv.tmp Io.argv.tmp`; + +if ($x eq "1a line\n2a line\n") {print "ok 1\n";} else {print "not ok 1\n";} + +$x = `echo foo|./perl -e 'while (<>) {print $_;}' Io.argv.tmp -`; + +if ($x eq "a line\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";} + +$x = `echo foo|./perl -e 'while (<>) {print $_;}'`; + +if ($x eq "foo\n") {print "ok 3\n";} else {print "not ok 3 :$x:\n";} + +@ARGV = ('Io.argv.tmp', 'Io.argv.tmp', '/dev/null', 'Io.argv.tmp'); +while (<>) { + $y .= $. . $_; + if (eof()) { + if ($. == 3) {print "ok 4\n";} else {print "not ok 4\n";} + } +} + +if ($y eq "1a line\n2a line\n3a line\n") + {print "ok 5\n";} +else + {print "not ok 5\n";} + +`/bin/rm -f Io.argv.tmp`; |