Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • CPAN::Reporter ignores that and just looks for the grade at the end, so green light from me.

    What do you do if the test file name is longer than your fixed column width?


    -- dagolden
  • While we are on the topic of Test::Harness output, a change that I'd like to see is padding of the test number so that test comments are aligned.

    For example consider the following trimmed down test program and output:

    use Test::More tests => 11;

    for (1 .. 11) {
        is(1, 1, 'This is a comment');


    perl output1.t
    ok 1 - This is a comment
    ok 2 - This is a comment
    ok 3 - This is a comment
    ok 4 - This is a comment
    ok 5 - This is a comment
    ok 6 - This is a comment
    ok 7 - This is a comment

    • I like this thought because things which improves comprehension are good, but there are a couple of issues here. First, many test descriptions (what you're referring to as a comment), are often close to the width of whatever terminal I'm working with, so pushing them out even further may be problematic. Second, since we don't always know up front how many tests will be run, we won't know what padding would be needed.

      However, rather than a specific solution like this, how about a more general one?

      prove -r

      • There’s not much we could do to stop that

        You could generate a test message with this format and try to parse it and see that the parts all where you expected them. (Should the parts be randomly generated so the user can’t fool you?) If that fails you tell the user that their format is no good and bail.

        • Should the parts be randomly generated so the user can’t fool you?

          Ah, no, there is a simpler way, which is to try twice, with messages that differ in all parts.