X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F39-localize_elem-target.t;h=ecff42bb2ab765847e25e74b89561ac4075cef50;hb=1a52b3489cc6cdf5c139fc68828e7e0d6ae128fd;hp=786ce5582c137fcde7e5f2b1df3535016a35fedb;hpb=e7bb90c3e0eb82712d5eda47563ca77269bbdbac;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/39-localize_elem-target.t b/t/39-localize_elem-target.t index 786ce55..ecff42b 100644 --- a/t/39-localize_elem-target.t +++ b/t/39-localize_elem-target.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 17; use Scope::Upper qw/localize_elem/; @@ -42,6 +42,19 @@ our @a; is_deeply \@a, [ 4 .. 6 ], 'localize_elem "@a", 1, 12, 1 [end]'; } +{ + local @a = (4 .. 6); + { + local @a = (5 .. 7); + { + localize_elem '@main::a', 4, 12, 1; + is_deeply \@a, [ 5 .. 7 ], 'localize_elem "@a", 4, 12, 1 [not yet]'; + } + is_deeply \@a, [ 5 .. 7, undef, 12 ], 'localize_elem "@a", 4, 12, 1 [ok]'; + } + is_deeply \@a, [ 4 .. 6 ], 'localize_elem "@a", 4, 12, 1 [end]'; +} + # Hashes our %h;