diff options
author | Robin Houston <robin@cpan.org> | 2001-12-17 20:07:02 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-17 19:12:16 +0000 |
commit | 48beb55fa0a89cedb5fb1dc2234a5526f85daa04 (patch) | |
tree | 15ebe44dfab5b8173a18ff8480e56fffc9ab842c | |
parent | 507b98002a6c136d628abe928988647938c55cff (diff) | |
download | perl-48beb55fa0a89cedb5fb1dc2234a5526f85daa04.tar.gz |
Re: [PATCH] ...while $var = glob(...)
Message-ID: <20011217200702.A17721@puffinry.freeserve.co.uk>
p4raw-id: //depot/perl@13741
-rwxr-xr-x | t/op/glob.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/glob.t b/t/op/glob.t index 8bdf64f932..1dd806eb88 100755 --- a/t/op/glob.t +++ b/t/op/glob.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..10\n"; +print "1..13\n"; @oops = @ops = <op/*>; @@ -60,3 +60,13 @@ $j=1; %j=(a=>1); @j=(1); local *j=*j; *j = sub{}; print $j == 1 ? "ok 8\n" : "not ok 8\n"; print $j{a} == 1 ? "ok 9\n" : "not ok 9\n"; print $j[0] == 1 ? "ok 10\n" : "not ok 10\n"; + +# ... while ($var = glob(...)) should test definedness not truth + +# Create a file called "0" +print open(F, ">0") ? "ok 11\n" : "not ok 11 # $!\n"; +my $ok = "not ok 12\n"; +$ok = "ok 12\n" while my $var = glob("0"); +print $ok; + +print unlink("0") ? "ok 13\n" : "not ok 13\n"; |