X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Op.git;a=blobdiff_plain;f=t%2F11-existing.t;h=2e6c6ca11a424a372f23e54c249e309926e70ad0;hp=749fff136fa63311fd3925a2032b383dc6b2dd6a;hb=3571f5a5bbffc758bbb91793ae256609d71945fc;hpb=a0c0873977f66d8024a988b8dbd8e1c092927189 diff --git a/t/11-existing.t b/t/11-existing.t index 749fff1..2e6c6ca 100644 --- a/t/11-existing.t +++ b/t/11-existing.t @@ -5,7 +5,7 @@ use warnings; use blib 't/Sub-Op-LexicalSub'; -use Test::More tests => 2 * ((1 + 2) * 4 + (1 + 1) * 5) + (2 + 2) + 4; +use Test::More tests => 2 * ((2 + 2) * 4 + (1 + 2) * 5) + (2 + 2) + 4; our $call_foo; sub foo { ok $call_foo, 'the preexistent foo was called' } @@ -44,7 +44,7 @@ our $called; @seq = ($names[0]) x $calls; } - my $test = "{\n"; + my $test = "{\n{\n"; for my $name (@names) { $test .= <<" INIT" use Sub::Op::LexicalSub $name => sub { @@ -59,6 +59,15 @@ our $called; } $test .= "{\n$code\n}\n"; $test .= "}\n"; + for my $name (grep +{ map +($_, 1), qw/foo bar/ }->{ $_ }, @names) { + $test .= <<" CHECK_SUB" + { + local \$call_$name = 1; + $name(); + } + CHECK_SUB + } + $test .= "}\n"; local $called = 0; eval $test;