use blib 't/Sub-Op-LexicalSub';
-use Test::More tests => 2 * 15 + 3 * 2 + 2 * 28;
+use Test::More tests => (1 + 3) * 16 + (1 + 2 * 3) * 2 + 2 * 29;
our $called;
$test .= <<" CHECK_VIVID"
BEGIN {
no warnings 'uninitialized'; # Test::Builder can't get the file name
- is *main::${name}\{CODE\}, undef, '$name: no symbol table vivification';
+ ok !exists &main::${name}, '$name: not stubbed';
+ ok !defined &main::${name}, '$name: body not defined';
+ is *main::${name}\{CODE\}, undef, '$name: empty symbol table entry';
}
CHECK_VIVID
}
is $called, $calls, "@names: the hook was called the right number of times";
if ($called < $calls) {
- fail for $called + 1 .. $calls;
+ fail, fail for $called + 1 .. $calls;
}
}
}
----
fetch # () # [ 1, undef, 2 ]
####
+my ($cb, $err);
+BEGIN {
+ $cb = do { no strict 'refs'; \&{__PACKAGE__.'::cvref'} };
+ eval { $cb->() };
+ $err = $@ =~ /^Undefined subroutine &main::cvref/ ? undef : $@;
+}
+cvref $err;
+----
+cvref # () # [ undef ]
+####
our $scalr = 1;
scalr $scalr;
----