From: Vincent Pit Date: Tue, 18 May 2010 19:48:12 +0000 (+0200) Subject: Tie the array after localizing it in t/{34,44}-*-magic.t X-Git-Tag: v0.12~7 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=a8e609b45a64bb946197d3f4b444a07e86c52209;p=perl%2Fmodules%2FScope-Upper.git Tie the array after localizing it in t/{34,44}-*-magic.t This fixes failures under perl 5.13 since Dave made "local @tied" untie the array. --- diff --git a/t/34-localize_elem-magic.t b/t/34-localize_elem-magic.t index 7a99222..361f77d 100644 --- a/t/34-localize_elem-magic.t +++ b/t/34-localize_elem-magic.t @@ -20,9 +20,10 @@ use Test::More tests => 8; our @a; -tie @a, 'Scope::Upper::Test::TiedArray'; { - local @a = (5 .. 7); + local @a; + tie @a, 'Scope::Upper::Test::TiedArray'; + @a = (5 .. 7); { localize_elem '@a', 4 => 12 => HERE; is_deeply \@a, [ 5 .. 7, undef, 12 ], 'localize_elem @incomplete_tied_array, $nonexistent, 12 => HERE [ok]'; diff --git a/t/44-localize_delete-magic.t b/t/44-localize_delete-magic.t index affe05b..bf0c43d 100644 --- a/t/44-localize_delete-magic.t +++ b/t/44-localize_delete-magic.t @@ -25,9 +25,10 @@ our $deleted; our @a; -tie @a, 'Scope::Upper::Test::TiedArray'; { - local @a = (5 .. 7); + local @a; + tie @a, 'Scope::Upper::Test::TiedArray'; + @a = (5 .. 7); local $a[4] = 9; is $deleted, undef, 'localize_delete @tied_array, $existent => HERE [not deleted]'; { @@ -40,7 +41,9 @@ tie @a, 'Scope::Upper::Test::TiedArray'; } { - local @a = (4 .. 6); + local @a; + tie @a, 'Scope::Upper::Test::TiedArray'; + @a = (4 .. 6); local $a[4] = 7; { localize_delete '@main::a', -1 => HERE; @@ -53,7 +56,9 @@ SKIP: { skip '$NEGATIVE_INDICES has no special meaning on 5.8.0 and older' => 2 if $] < 5.008_001; local $Scope::Upper::Test::TiedArray::NEGATIVE_INDICES = 1; - local @a = (4 .. 6); + local @a; + tie @a, 'Scope::Upper::Test::TiedArray'; + @a = (4 .. 6); local $a[4] = 7; { localize_delete '@main::a', -1 => HERE;