diff options
author | Nathan Torkington <gnat@frii.com> | 2003-04-12 12:40:45 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-04-14 19:34:42 +0000 |
commit | a28cd5c9762e7188f862844ca6b6674b912f33f8 (patch) | |
tree | 440cbf90415c72a74fa2613ca53024c9d0438983 /t | |
parent | 244d9cb7d1d2e3a6aaa13f677e17b42673b10de9 (diff) | |
download | perl-a28cd5c9762e7188f862844ca6b6674b912f33f8.tar.gz |
Document and test autovivified dirhandles.
Subject: [perl #21952] [patch] t/op/readdir.t and perlfunc.pod
From: Nathan Torkington (via RT) <perlbug-followup@perl.org>
Message-Id: <rt-21952-55079.8.08945458828887@bugs6.perl.org>
p4raw-id: //depot/perl@19207
Diffstat (limited to 't')
-rwxr-xr-x | t/op/readdir.t | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/t/op/readdir.t b/t/op/readdir.t index 83451d3d68..ee641227b7 100755 --- a/t/op/readdir.t +++ b/t/op/readdir.t @@ -8,7 +8,7 @@ BEGIN { eval 'opendir(NOSUCH, "no/such/directory");'; if ($@) { print "1..0\n"; exit; } -print "1..3\n"; +print "1..11\n"; for $i (1..2000) { local *OP; @@ -44,3 +44,12 @@ while (@R && @G && $G[0] eq ($^O eq 'MacOS' ? ':op:' : 'op/').$R[0]) { shift(@G); } if (@R == 0 && @G == 0) { print "ok 3\n"; } else { print "not ok 3\n"; } + +if (opendir($fh, "op")) { print "ok 4\n"; } else { print "not ok 4\n"; } +if (ref($fh) eq 'GLOB') { print "ok 5\n"; } else { print "not ok 5\n"; } +if (opendir($fh[0], "op")) { print "ok 6\n"; } else { print "not ok 6\n"; } +if (ref($fh[0]) eq 'GLOB') { print "ok 7\n"; } else { print "not ok 7\n"; } +if (opendir($fh{abc}, "op")) { print "ok 8\n"; } else { print "not ok 8\n"; } +if (ref($fh{abc}) eq 'GLOB') { print "ok 9\n"; } else { print "not ok 9\n"; } +if ("$fh" ne "$fh[0]") { print "ok 10\n"; } else { print "not ok 10\n"; } +if ("$fh" ne "$fh{abc}") { print "ok 11\n"; } else { print "not ok 11\n"; } |