t/00-load.t
t/01-import.t
t/05-words.t
-t/10-reap.t
t/11-reap-level.t
t/12-reap-block.t
t/13-reap-ctl.t
+t/15-reap-multi.t
t/20-localize-target.t
-t/20-localize.t
t/21-localize-level.t
t/22-localize-block.t
t/23-localize-ctl.t
+t/25-localize-multi.t
t/30-localize_elem-target.t
t/31-localize_elem-level.t
t/32-localize_elem-block.t
use strict;
use warnings;
-use Test::More tests => 4 + 8 + 8 + 18 + 4 + 8 + 6 + 11 + 5 + 17;
+use Test::More tests => 8 + 18 + 4 + 8 + 11 + 5 + 17;
use Scope::Upper qw/reap/;
sub add { local $_; my $y = $_[1]; reap sub { $x += $y }, $_[0] + 1 }
-$x = 0;
-{
- is($x, 0, 'start');
- {
- add(0, 1);
- is($x, 0, '1 didn\'t run');
- }
- is($x, 1, '1 ran');
-}
-is($x, 1, 'end');
-
-$x = 0;
-{
- is($x, 0, 'start');
- local $_ = 3;
- is($_, 3, '$_ has the right value');
- {
- add(0, 1);
- is($_, 3, '$_ has the right value');
- local $_ = 7;
- is($_, 7, '$_ has the right value');
- is($x, 0, '1 didn\'t run');
- }
- is($x, 1, '1 ran');
- is($_, 3, '$_ has the right value');
-}
-is($x, 1, 'end');
-
$x = 0;
{
is($x, 0, 'start');
}
is($x, 3, 'end');
-$x = 0;
-{
- is($x, 0, 'start');
- {
- {
- {
- add(2, 1);
- is($x, 0, '1 didn\'t run');
- }
- is($x, 0, '1 didn\'t run');
- }
- is($x, 0, '1 didn\'t run');
- }
- is($x, 1, '1 ran');
-}
-is($x, 1, 'end');
-
$x = 0;
{
is($x, 0, 'start');
use strict;
use warnings;
-use Test::More tests => 4 + 10 + 6 + 5 + 6;
+use Test::More tests => 10 + 5 + 6;
use Scope::Upper qw/localize/;
sub loc { local $x; my $y = $_[1]; localize '$x', $y, $_[0] + 1 }
-$x = 0;
-{
- is($x, 0, 'start');
- local $x = 7;
- {
- local $x = 8;
- loc(0, 1);
- is($x, 1, 'localized to 1');
- }
- is($x, 7, 'no longer localized');
-}
-is($x, 0, 'end');
-
$x = 0;
{
is($x, 0, 'start');
}
is($x, 0, 'end');
-$x = 0;
-{
- is($x, 0, 'start');
- local $x = 7;
- {
- local $x = 8;
- {
- local $x = 9;
- {
- local $x = 10;
- loc(2, 1);
- is($x, 10, 'not localized');
- }
- is($x, 9, 'not localized');
- }
- is($x, 1, 'localized to 1');
- }
- is($x, 7, 'no longer localized');
-}
-is($x, 0, 'end');
-
$x = 0;
{
is($x, 0, 'start');