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' }
@seq = ($names[0]) x $calls;
}
- my $test = "{\n";
+ my $test = "{\n{\n";
for my $name (@names) {
$test .= <<" INIT"
use Sub::Op::LexicalSub $name => sub {
}
$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;