]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blob - t/26-localize-numerous.t
fix unwind()
[perl/modules/Scope-Upper.git] / t / 26-localize-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 UP>;
12
13 our $x = 0;
14 our $z = $n;
15
16 sub setup {
17  for (1 .. $n) {
18   localize *x, *z => UP UP;
19  }
20 }
21
22 is $x,  0,  '$x is correctly initialized';
23 {
24  setup;
25  is $x, $n, '$x is correctly localized';
26 }
27 is $x,  0,  '$x regained its original value';