summaryrefslogtreecommitdiff
path: root/t/io
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-12-28 20:42:13 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-28 20:42:13 +0000
commit820475bd7227fcbc2178bb45a4d501c4ccc2133b (patch)
tree891f521b63ab23fd1a7ff13d45a2de72d099aa6f /t/io
parentb26a54d078afd95fdb1f671f519e49b10272f657 (diff)
downloadperl-820475bd7227fcbc2178bb45a4d501c4ccc2133b.tar.gz
tests for change#4642 and pod fixups suggested by Ralph Corderoy
<ralph@inputplus.demon.co.uk> p4raw-link: @4642 on //depot/perl: db7ec62399075c965a182629c9ca8ed4044fc594 p4raw-id: //depot/perl@4732
Diffstat (limited to 't/io')
-rwxr-xr-xt/io/argv.t45
1 files changed, 43 insertions, 2 deletions
diff --git a/t/io/argv.t b/t/io/argv.t
index c6565dc9c7..3695e8abda 100755
--- a/t/io/argv.t
+++ b/t/io/argv.t
@@ -1,6 +1,15 @@
#!./perl
-print "1..6\n";
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
+
+print "1..14\n";
+
+use File::Spec;
+
+my $devnull = File::Spec->devnull;
open(try, '>Io.argv.tmp') || (die "Can't open temp file: $!");
print try "a line\n";
@@ -30,7 +39,7 @@ else {
}
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');
+@ARGV = ('Io.argv.tmp', 'Io.argv.tmp', $devnull, 'Io.argv.tmp');
while (<>) {
$y .= $. . $_;
if (eof()) {
@@ -55,5 +64,37 @@ while (<>) {
open(try, '<Io.argv.tmp') or die "Can't open temp file: $!";
print while <try>;
close try;
+undef $^I;
+
+eof try or print 'not ';
+print "ok 7\n";
+
+eof NEVEROPENED or print 'not ';
+print "ok 8\n";
+
+open STDIN, 'Io.argv.tmp' or die $!;
+@ARGV = ();
+!eof() or print 'not ';
+print "ok 9\n";
+
+<> eq "ok 6\n" or print 'not ';
+print "ok 10\n";
+
+open STDIN, $devnull or die $!;
+@ARGV = ();
+eof() or print 'not ';
+print "ok 11\n";
+
+@ARGV = ('Io.argv.tmp');
+!eof() or print 'not ';
+print "ok 12\n";
+
+@ARGV = ($devnull, $devnull);
+!eof() or print 'not ';
+print "ok 13\n";
+
+close ARGV or die $!;
+eof() or print 'not ';
+print "ok 14\n";
END { unlink 'Io.argv.tmp', 'Io.argv.tmp.bak' }