]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blob - t/46-localize_delete-numerous.t
fix unwind()
[perl/modules/Scope-Upper.git] / t / 46-localize_delete-numerous.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 my $n;
7 BEGIN { $n = 1000; }
8
9 use Test::More tests => 3;
10
11 use Scope::Upper qw<localize_delete UP>;
12
13 our @A = (1 .. $n);
14
15 sub setup {
16  for (reverse 0 .. ($n-1)) {
17   localize_delete '@A', $_ => UP UP;
18  }
19 }
20
21 is_deeply  \@A, [ 1 .. $n ], '@A was correctly initialized';
22 {
23  setup;
24  is_deeply \@A, [ ],         '@A is empty inside the block';
25 }
26 is_deeply  \@A, [ 1 .. $n ], '@A regained its elements';