summaryrefslogtreecommitdiff
path: root/t/op/splice.t
diff options
context:
space:
mode:
authordaniel@biz.bitpusher.com <daniel@biz.bitpusher.com>2001-07-11 16:25:47 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2001-07-12 13:32:05 +0000
commitaae9faaef48c83ef5b906434cb0a359c3263c598 (patch)
tree4e29b39974460fb9515479a15b374e4dce46c325 /t/op/splice.t
parentae7d165c0b89e5ee4f4efe1fcd0b5806caf58351 (diff)
downloadperl-aae9faaef48c83ef5b906434cb0a359c3263c598.tar.gz
[ID 20010711.005] in Tie::Array, SPLICE ignores context, breaking SHIFT
Message-Id: <200107120625.f6C6PkJ13065@biz.bitpusher.com> p4raw-id: //depot/perl@11306
Diffstat (limited to 't/op/splice.t')
-rwxr-xr-xt/op/splice.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/op/splice.t b/t/op/splice.t
index 3b4229a031..d1bfe999e5 100755
--- a/t/op/splice.t
+++ b/t/op/splice.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..10\n";
+print "1..12\n";
@a = (1..10);
@@ -37,4 +37,18 @@ print "ok 9\n";
print "not " unless j(splice(@a)) eq j(1,2,7,3) && j(@a) eq '';
print "ok 10\n";
+# Tests 11 and 12:
+# [ID 20010711.005] in Tie::Array, SPLICE ignores context, breaking SHIFT
+
+my $foo;
+
+@a = ('red', 'green', 'blue');
+$foo = splice @a, 1, 2;
+print "not " unless $foo eq 'blue';
+print "ok 11\n";
+
+@a = ('red', 'green', 'blue');
+$foo = shift @a;
+print "not " unless $foo eq 'red';
+print "ok 12\n";