Subject: | Mangling Test::More's @EXPORT causes confusion when combined with Test::Aggregate |
I was in a small test script using only Test::More
but was receiving weird errors trying to use `diag explain $obj` for
debugging.
The errors varied from indirect-object syntax on an unblessed reference
to undefined sub, etc (depending on what I changed to try to figure out
the problem).
I traced it down the the fact that my test script was being run under
Test::Aggregate which was launched from a test script that uses
Test::Most. I found in the source code that Test::Most splices
'explain' out of @Test::More::EXPORT (which is why it wasn't being
imported here).
So after some confusion and some digging I guess I'm just wondering if
this is necessary. I tried to look at the source history but that code
was there from the first 'lost the history' commit i found on github.
Was that necessary just to avoid importing `explain` into your own
namespace? Or was there also a problem of it getting exported to the
main package?
In the end it may not even be worth dealing with,
but it was darn confusing there for a while :-)
Just something you need to know when combining all these pieces
together, I guess.
I guess if you're using Test::Most somewhere in the beginning you might
as well be using it later down the line, at which point you'd already
know that 'explain' was different in Test::Most.
Does this maybe warrant a mention in the documentation?