diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-02 03:36:41 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-02 03:36:41 +0000 |
commit | 4bd46447950ba8dfb481e9515d0a88ed358d2013 (patch) | |
tree | 09130fba80b96da6223b8726c171f711e6b550c2 /t | |
parent | a98df9627d19bd75c4b1132fc26e037aab5a7879 (diff) | |
download | perl-4bd46447950ba8dfb481e9515d0a88ed358d2013.tar.gz |
make exists() work better on pseudo-hashes (reworked a patch suggested
by Michael G Schwern <schwern@pobox.com>)
p4raw-id: //depot/perl@4279
Diffstat (limited to 't')
-rwxr-xr-x | t/op/avhv.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/avhv.t b/t/op/avhv.t index 6837127d52..92afa37d37 100755 --- a/t/op/avhv.t +++ b/t/op/avhv.t @@ -17,7 +17,7 @@ sub STORESIZE { $#{$_[0]} = $_[1]+1 } package main; -print "1..12\n"; +print "1..15\n"; $sch = { 'abc' => 1, @@ -108,3 +108,13 @@ f($a->{key}); print "not " unless $a->[1] eq 'b'; print "ok 12\n"; +# check if exists() is behaving properly +$avhv = [{foo=>1,bar=>2,pants=>3}]; +print "not " if exists $avhv->{bar}; +print "ok 13\n"; + +$avhv->{pants} = undef; +print "not " unless exists $avhv->{pants}; +print "ok 14\n"; +print "not " if exists $avhv->{bar}; +print "ok 15\n"; |