summaryrefslogtreecommitdiff
path: root/t/op/chop.t
diff options
context:
space:
mode:
authorRadu Greab <radu@netsoft.ro>2001-03-07 01:04:44 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-07 14:51:17 +0000
commit2ec6af5f978df7271f6d544a10f1ed025070c53f (patch)
tree520f818e80fe14ecbecedf48d63b45be0cb9cd8a /t/op/chop.t
parent770fab92d753b1aa3cfd2d1bbafe0e666303a23a (diff)
downloadperl-2ec6af5f978df7271f6d544a10f1ed025070c53f.tar.gz
Re: [ID 20010305.012] chop() against list assignment returns char chopped from el zero
Message-ID: <15013.20716.201459.540421@ix.netsoft.ro> p4raw-id: //depot/perl@9068
Diffstat (limited to 't/op/chop.t')
-rwxr-xr-xt/op/chop.t15
1 files changed, 12 insertions, 3 deletions
diff --git a/t/op/chop.t b/t/op/chop.t
index 9edddedaf7..1b55f11832 100755
--- a/t/op/chop.t
+++ b/t/op/chop.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..34\n";
+print "1..37\n";
# optimized
@@ -104,6 +104,15 @@ $_ = "\x{1234}\x{2345}";
chop;
print $_ eq "\x{1234}" ? "ok 33\n" : "not ok 33\n";
-# TODO! Make sure chop(LIST) returns the right value.
my @stuff = qw(this that);
-print chop(@stuff[0,1]) eq 't' ? "ok 34 # TODO\n" : "not ok 34 # TODO\n";
+print chop(@stuff[0,1]) eq 't' ? "ok 34\n" : "not ok 34\n";
+
+# bug id 20010305.012
+@stuff = qw(ab cd ef);
+print chop(@stuff = @stuff) eq 'f' ? "ok 35\n" : "not ok 35\n";
+
+@stuff = qw(ab cd ef);
+print chop(@stuff[0, 2]) eq 'f' ? "ok 36\n" : "not ok 36\n";
+
+my %stuff = (1..4);
+print chop(@stuff{1, 3}) eq '4' ? "ok 37\n" : "not ok 37\n";