summaryrefslogtreecommitdiff
path: root/ext/arybase/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-02-01 13:29:28 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-02-01 13:44:29 -0800
commit60aa0b5df451ec35a916c5ff586c7890e804c5ff (patch)
tree450e828ebc1c2f058234e169b468f973e2968e89 /ext/arybase/t
parent402642c6301a1dbc64ea3acc8beee35078afee26 (diff)
downloadperl-60aa0b5df451ec35a916c5ff586c7890e804c5ff.tar.gz
[perl #109570] Fix off-by-1 error in arybase’s lslice
When I wrote that originally, I was treating POPMARK as equivalent to --*PL_markstack_ptr, rather than *PL_markstack_ptr--. So I was using the marker for the outer list surrounding the list slice, and modifying whatever numbers were to be found there, such as the 3 and 4 in [3, 4, qw(foo bar)[0]].
Diffstat (limited to 'ext/arybase/t')
-rw-r--r--ext/arybase/t/lslice.t3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/arybase/t/lslice.t b/ext/arybase/t/lslice.t
index c012b84f5e..0db7a078f2 100644
--- a/ext/arybase/t/lslice.t
+++ b/ext/arybase/t/lslice.t
@@ -1,7 +1,7 @@
use warnings; no warnings 'deprecated';
use strict;
-use Test::More tests => 11;
+use Test::More tests => 12;
our @i4 = (3, 5, 3, 5);
@@ -11,6 +11,7 @@ is_deeply [ scalar qw(a b c d e f)[3,4] ], [ qw(b) ];
is_deeply [ qw(a b c d e f)[3,4,8,9] ], [ qw(a b f), undef ];
is_deeply [ scalar qw(a b c d e f)[@i4] ], [ qw(c) ];
is_deeply [ qw(a b c d e f)[@i4] ], [ qw(a c a c) ];
+is_deeply [ 3, 4, qw(a b c d e f)[@i4] ], [ 3, 4, qw(a c a c) ];
is_deeply [ qw(a b c d e f)[-1,-2] ], [ qw(f e) ];
is_deeply [ qw(a b c d e f)[2,1] ], [ qw(f e) ];