X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F34-localize_elem-magic.t;h=307db88d298f9544089ab024e0e168a81e719cd1;hb=948b920914bab8ee2ae0f0999b7e46b00b009a3e;hp=2754885a41aa7b04fa6412ec646690271ad5d103;hpb=cd7bfde845927d38ca43bd7430503f388260d53a;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/34-localize_elem-magic.t b/t/34-localize_elem-magic.t index 2754885..307db88 100644 --- a/t/34-localize_elem-magic.t +++ b/t/34-localize_elem-magic.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Scope::Upper qw/localize_elem/; +use Scope::Upper qw; use Test::More tests => 8; @@ -20,14 +20,15 @@ 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 => 0; - is_deeply \@a, [ 5 .. 7, undef, 12 ], 'localize_elem @incomplete_tied_array, $nonexistent, 12 => 0 [ok]'; + localize_elem '@a', 4 => 12 => HERE; + is_deeply \@a, [ 5 .. 7, undef, 12 ], 'localize_elem @incomplete_tied_array, $nonexistent, 12 => HERE [ok]'; } - is_deeply \@a, [ 5 .. 7, undef, undef ], 'localize_elem @incomplete_tied_array, $nonexistent, 12 => 0 [end]'; + is_deeply \@a, [ 5 .. 7, undef, undef ], 'localize_elem @incomplete_tied_array, $nonexistent, 12 => HERE [end]'; } our $x; @@ -37,7 +38,7 @@ our $x; local $SIG{__WARN__} = sub { }; { { - localize_elem '%SIG', '__WARN__' => sub { $x = join '', @_ }, 1; + localize_elem '%SIG', '__WARN__' => sub { $x = join '', @_ } => UP; is $x, undef, 'localize_elem $SIG{__WARN__} [not yet]'; } warn "1\n"; @@ -67,7 +68,7 @@ my $time = time; local $ENV{SCOPE_UPPER_TEST}; { { - localize_elem '%ENV', 'SCOPE_UPPER_TEST' => $time, 1; + localize_elem '%ENV', 'SCOPE_UPPER_TEST' => $time => UP; runperl $time, 0, 'localize_elem $ENV{SCOPE_UPPER_TEST} [not yet]'; } runperl $time, 1, 'localize_elem $ENV{SCOPE_UPPER_TEST} [ok]';