diff options
author | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
commit | fe14fcc35f78a371a174a1d14256c2f35ae4262b (patch) | |
tree | d472cb1055c47b9701cb0840969aacdbdbc9354a /t/op/delete.t | |
parent | 27e2fb84680b9cc1db17238d5bf10b97626f477f (diff) | |
download | perl-fe14fcc35f78a371a174a1d14256c2f35ae4262b.tar.gz |
perl 4.0.00: (no release announcement available)perl-4.0.00
So far, 4.0 is still a beta test version. For the last production
version, look in pub/perl.3.0/kits@44.
Diffstat (limited to 't/op/delete.t')
-rw-r--r-- | t/op/delete.t | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/op/delete.t b/t/op/delete.t new file mode 100644 index 0000000000..b5920dd397 --- /dev/null +++ b/t/op/delete.t @@ -0,0 +1,29 @@ +#!./perl + +# $Header: delete.t,v 4.0 91/03/20 01:51:56 lwall Locked $ + +print "1..6\n"; + +$foo{1} = 'a'; +$foo{2} = 'b'; +$foo{3} = 'c'; + +$foo = delete $foo{2}; + +if ($foo eq 'b') {print "ok 1\n";} else {print "not ok 1 $foo\n";} +if ($foo{2} eq '') {print "ok 2\n";} else {print "not ok 2 $foo{2}\n";} +if ($foo{1} eq 'a') {print "ok 3\n";} else {print "not ok 3\n";} +if ($foo{3} eq 'c') {print "ok 4\n";} else {print "not ok 4\n";} + +$foo = join('',values(foo)); +if ($foo eq 'ac' || $foo eq 'ca') {print "ok 5\n";} else {print "not ok 5\n";} + +foreach $key (keys foo) { + delete $foo{$key}; +} + +$foo{'foo'} = 'x'; +$foo{'bar'} = 'y'; + +$foo = join('',values(foo)); +if ($foo eq 'xy' || $foo eq 'yx') {print "ok 6\n";} else {print "not ok 6\n";} |