Subject: | Test failure due to incorrect path regex in util.pl |
./Build test
fails with
t/05_api_baseclass......ok 1/15Cannot open /testing.key: No such file
or directory, stopped
at /home/marc/perl/WebService-ISBNDB-0.34/t/util.pl line 8.
# Looks like you planned 15 tests but only ran 8.
# Looks like your test died just after 8.
t/05_api_baseclass......dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 9-15
Failed 7/15 tests, 53.33% okay
t/07_agent_baseclass....ok
t/10_categories.........Cannot open /testing.key: No such file or
directory, stopped at /home/marc/perl/WebService-ISBNDB-0.34/t/util.pl
line 8.
# Looks like your test died before it could output anything.
t/10_categories.........dubious
Test returned status 255 (wstat 65280, 0xff00)
t/20_publishers.........Cannot open /testing.key: No such file or
directory, stopped at /home/marc/perl/WebService-ISBNDB-0.34/t/util.pl
line 8.
# Looks like your test died before it could output anything.
t/20_publishers.........dubious
Test returned status 255 (wstat 65280, 0xff00)
t/30_subjects...........Cannot open /testing.key: No such file or
directory, stopped at /home/marc/perl/WebService-ISBNDB-0.34/t/util.pl
line 8.
# Looks like your test died before it could output anything.
t/30_subjects...........dubious
Test returned status 255 (wstat 65280, 0xff00)
t/40_authors............Cannot open /testing.key: No such file or
directory, stopped at /home/marc/perl/WebService-ISBNDB-0.34/t/util.pl
line 8.
# Looks like your test died before it could output anything.
t/40_authors............dubious
Test returned status 255 (wstat 65280, 0xff00)
t/50_books..............Cannot open /testing.key: No such file or
directory, stopped at /home/marc/perl/WebService-ISBNDB-0.34/t/util.pl
line 8.
# Looks like your test died before it could output anything.
t/50_books..............dubious
Test returned status 255 (wstat 65280, 0xff00)
t/60_iterator...........Cannot open /testing.key: No such file or
directory, stopped at /home/marc/perl/WebService-ISBNDB-0.34/t/util.pl
line 8.
# Looks like your test died before it could output anything.
t/60_iterator...........dubious
Test returned status 255 (wstat 65280, 0xff00)
This is due to a faulty regular expression at line 8 ot t/util.pl.
Change
(my $keyfile = __FILE__) =~ s|/(.*?)$|/|;
to
(my $keyfile = __FILE__) =~ s|/([^/]*?)$|/|;
And the tests pass as expected.