From 0960ff5ae77d081b538d8f0690367bb5144cf1c1 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 28 Oct 2012 01:44:31 -0700 Subject: =?UTF-8?q?Don=E2=80=99t=20skip=20tied=20EXISTS=20for=20negative?= =?UTF-8?q?=20array=20indices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was broken in 5.14.0 for those cases where $NEGATIVE_INDICES is not true: sub TIEARRAY{bless[]}; sub FETCHSIZE { 50 } sub EXISTS { print "does $_[1] exist?\n" } tie @a, ""; exists $a[1]; exists $a[-1]; $NEGATIVE_INDICES=1; exists $a[-1]; $ pbpaste|perl5.12.0 does 1 exist? does 49 exist? does -1 exist? $ pbpaste|perl5.14.0 does 1 exist? does -1 exist? This was broken by 54a4274e3c. --- t/op/tie.t | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't/op/tie.t') diff --git a/t/op/tie.t b/t/op/tie.t index 5808a09524..83f10dd5ac 100644 --- a/t/op/tie.t +++ b/t/op/tie.t @@ -1302,3 +1302,18 @@ each %$h; delete $$h{foo}; tie %$h, 'l'; EXPECT +######## + +# NAME EXISTS on arrays +sub TIEARRAY{bless[]}; +sub FETCHSIZE { 50 } +sub EXISTS { print "does $_[1] exist?\n" } +tie @a, ""; +exists $a[1]; +exists $a[-1]; +$NEGATIVE_INDICES=1; +exists $a[-1]; +EXPECT +does 1 exist? +does 49 exist? +does -1 exist? -- cgit v1.2.1