Am I missing something here? I set up a bunch of tests using
Test::More. But for some reason, when a test fails, I don't get the test name, just the test number and line number.
Did I misunderstand the whole idea of $test_name?
The test is something like this:
foreach (@items) {
... a lot of perl code ...
unless (some condition) {
$err = "Splunk is missing from Foobar";
}
}
if ($err) { # <------- line 60
fail($err);
} else {
pass("Fancy code passed");
}
$ ./t/test.pl t/DB/SearchPart.t
+
t/DB/SearchPart....NOK 3
+
# Failed test (t/DB/SearchPart.t at line 60)
# Looks like you failed 1 test of 3.
t/DB/SearchPart....dubious
+
Test returned status 1 (wstat 256, 0x100)
Scalar found where operator expected at (eval 158) line 1, near "'int'
+ $__val"
(Missing operator before $__val?)
DIED. FAILED test 3
Failed 1/3 tests, 66.67% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
----------------------------------------------------------------------
+---------
t/DB/SearchPart.t 1 256 3 1 33.33% 3
Failed 1/1 test scripts, 0.00% okay. 1/3 subtests failed, 66.67% okay.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.