diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-13 06:49:03 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-13 06:49:03 +0000 |
commit | 010205895f86f073b0b2a20bd4cfbb05f0134888 (patch) | |
tree | c882a2e58a11ea7da9d88e25008bea82fca68ee2 /t/op/avhv.t | |
parent | 629ae16350754a5d73cb2e1548dcefcae5ddeda1 (diff) | |
download | perl-010205895f86f073b0b2a20bd4cfbb05f0134888.tar.gz |
support delete() and exists() on array, tied array, and pseudo-hash
elements or slices
p4raw-id: //depot/perl@4796
Diffstat (limited to 't/op/avhv.t')
-rwxr-xr-x | t/op/avhv.t | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/t/op/avhv.t b/t/op/avhv.t index 92afa37d37..23f9c69c8c 100755 --- a/t/op/avhv.t +++ b/t/op/avhv.t @@ -17,7 +17,7 @@ sub STORESIZE { $#{$_[0]} = $_[1]+1 } package main; -print "1..15\n"; +print "1..20\n"; $sch = { 'abc' => 1, @@ -118,3 +118,24 @@ print "not " unless exists $avhv->{pants}; print "ok 14\n"; print "not " if exists $avhv->{bar}; print "ok 15\n"; + +$avhv->{bar} = 10; +print "not " unless exists $avhv->{bar} and $avhv->{bar} == 10; +print "ok 16\n"; + +$v = delete $avhv->{bar}; +print "not " unless $v == 10; +print "ok 17\n"; + +print "not " if exists $avhv->{bar}; +print "ok 18\n"; + +$avhv->{foo} = 'xxx'; +$avhv->{bar} = 'yyy'; +$avhv->{pants} = 'zzz'; +@x = delete @{$avhv}{'foo','pants'}; +print "# @x\nnot " unless "@x" eq "xxx zzz"; +print "ok 19\n"; + +print "not " unless "$avhv->{bar}" eq "yyy"; +print "ok 20\n"; |