in reply to Re: Test::Pod:Coverage: excluding 'used' modules
in thread Test::Pod:Coverage: excluding 'used' modules

I also expected that Pod::Coverage would exclude the imported modules. However, I do have Date::Manip on my system and the unit tests which rely on it pass. None of the other included modules causes a problem, so maybe Date::Manip is doing something weird?

Thanks,

loris

  • Comment on Re^2: Test::Pod:Coverage: excluding 'used' modules

Replies are listed 'Best First'.
Re^3: Test::Pod:Coverage: excluding 'used' modules
by tobyink (Canon) on Nov 15, 2019 at 16:14 UTC

    I was quite vague about "doing something weird". Specifically, I was alluding to installing subs in the caller package in such a way that they don't look like they've been imported. This can be achieved using Sub::Util/Sub::Name or eval, but Date::Manip isn't doing that.

    I really do think your test script is having problems even loading Date::Manip. Is @INC the same for this pod test as for your other tests?

      OK, I seem to have been indulging in some cargo-cult programming. My pod-covarage.t looked like this:

      #!perl -T use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD co +verage" if $@; all_pod_coverage_ok();

      If I delete the shebang line, everything is OK. I'm not sure where the line came from - I had to look up the meaning of the option '-T', so I don't think it was anything I added consciously. Strangely this line crops in other copies of pod-covarage.t for other modules where it doesn't cause a problem. So there is still something odd going on.

      Cheers,

      loris

        "-T" is for taint mode. I don't think many people use it these days. It adds a little metadata to all strings to track whether they come from the outside world or not; the idea being that string data from the outside world is potentially untrustworthy, so shouldn't be interpolated directly into SQL queries, etc.

        Date::Manip does check an environment variable (which counts as tainted data) as part of its initialization, so that could be it?