Subject: | t/10_blacklist_require_chain.t is not testing what it thinks its testing |
t/10_blacklist_require_chain.t appears to be trying to test the code in
nextgen::blacklist that avoids blowing over an existing
CORE::GLOBAL::require. It isn't. nextgen::blacklist loads first via
the BEGIN block, then CORE::GLOBAL::require is set.
The test doesn't check that nextgen::blacklist's require override is
called, so the test only tests half the problem.
In order for it to work, CORE::GLOBAL::require would have to be set in a
BEGIN block before nextgen is loaded and actually work as a require().
Probably just setting a global variable indicating it was called.
Unfortunately I can't seem to write a CORE::GLOBAL::require that works.
I think its causing "use 5.10.1" to not really activate.
Also, rather than keeping the existing require override in a global, put
it in a lexical wrapper like so:
my $require = \&CORE::GLOBAL::require;
*CORE::GLOBAL::require = sub {
$require->(@_);
my_require(@_);
};
This will allow them to chain indefinitely.