Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy do my Perl module tests fail when I run them with Test::Harness::runtests?
    text
    copied!<p>I have a <a href="http://search.cpan.org/perldoc/Test::More" rel="nofollow noreferrer">Test::More</a> test script for a module we have made. When running the test script by itself, it works just as expected. Since there are several tests we need to run, I made a <a href="http://search.cpan.org/perldoc/Test::Harness" rel="nofollow noreferrer">Test::Harness</a> file that run all scripts. However, when executing from the <a href="http://search.cpan.org/perldoc/Test::Harness" rel="nofollow noreferrer">Test::Harness</a> <code>runtests</code> the script returns errors.</p> <p>During debugging I tried to run the script by using backtics and that worked. So the runtest command caused the errors. </p> <p>The code of the harness is pretty straightforward:</p> <pre><code>(perl) -w use strict; use warnings; use Test::Harness; my @tests = ('test1.pl', 'test2.pl', 'test3.pl'); runtests(@tests); </code></pre> <p>The errors originate from a cpan module we use, <a href="http://search.cpan.org/perldoc/Pod::HtmlEasy" rel="nofollow noreferrer">Pod::HtmlEasy</a>. </p> <p>The solution I'm hoping for is for a way to run the <a href="http://search.cpan.org/perldoc/Test::Harness" rel="nofollow noreferrer">Test::Harness</a> without getting the errors. </p> <p>The output from the test:</p> <pre> test1..........False [] range "\w-" in regex; marked by line 20. Use of uninitialized value in string ne at /app/perl/lib/Pod/HtmlEasy/Parser.pm line 422, line 20. Use of uninitialized value in string ne at /app/perl/lib/Pod/HtmlEasy/Parser.pm line 363, line 22. False [] range "\w-" in regex; marked by line 22. Use of uninitialized value in string ne at /app/perl/lib/Pod/HtmlEasy/Parser.pm line 488, line 24. Use of uninitialized value in string ne at /app/perl/lib/Pod/HtmlEasy/Parser.pm line 363, line 26. close() on unopened filehandle PODIN at /app/perl/lib/Pod/HtmlEasy.pm line 248. Use of uninitialized value in concatenation (.) or string at /app/perl/lib/Pod/HtmlEasy.pm line 318. (...) Use of uninitialized value in concatenation (.) or string at /app/perl/lib/Pod/HtmlEasy.pm line 396. test1..........ok 2/3close() on unopened filehandle PODIN at /app/perl/lib/Pod/HtmlEasy.pm line 248. Use of uninitialized value in concatenation (.) or string at /app/perl/lib/Pod/HtmlEasy.pm line 318. (...) Use of uninitialized value in concatenation (.) or string at /app/perl/lib/Pod/HtmlEasy.pm line 396. test1..........ok </pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload