From: Vincent Pit Date: Fri, 9 Jan 2009 18:09:55 +0000 (+0100) Subject: Introduce *5-*-multi.t tests X-Git-Tag: v0.04~19 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=ba2962546f4b0f74a79f373ad6617643d431da26;p=perl%2Fmodules%2FScope-Upper.git Introduce *5-*-multi.t tests --- diff --git a/MANIFEST b/MANIFEST index 9bbce5d..f18a425 100644 --- a/MANIFEST +++ b/MANIFEST @@ -8,15 +8,15 @@ samples/tag.pl 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 diff --git a/t/10-reap.t b/t/15-reap-multi.t similarity index 82% rename from t/10-reap.t rename to t/15-reap-multi.t index 11919dd..a3f7f3c 100644 --- a/t/10-reap.t +++ b/t/15-reap-multi.t @@ -3,7 +3,7 @@ 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/; @@ -11,34 +11,6 @@ my $x; 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'); @@ -128,23 +100,6 @@ $x = 0; } 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'); diff --git a/t/20-localize.t b/t/25-localize-multi.t similarity index 66% rename from t/20-localize.t rename to t/25-localize-multi.t index 35a22c6..f205e75 100644 --- a/t/20-localize.t +++ b/t/25-localize-multi.t @@ -3,7 +3,7 @@ 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/; @@ -11,19 +11,6 @@ our $x; 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'); @@ -49,27 +36,6 @@ $x = 0; } 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');