develooper Front page | perl.perl5.porters | Postings from October 2003

Re: require patch breaks locale

Thread Previous | Thread Next
From:
Abhijit Menon-Sen
Date:
October 8, 2003 23:49
Subject:
Re: require patch breaks locale
Message ID:
20031009121844.H10276@lustre.dyn.wiw.org
At 2003-10-09 07:36:19 +0200, abe@ztreet.demon.nl wrote:
>
> ~/Test-Smoke/perl-current/t$ PERL_UNICODE= LC_ALL=nl_NL.utf8 ./perl harness -v 
> comp/require.t
> comp/require....1..27
> ok 1
> ...
> ok 27
> ok 28
> ok 29
> ok 30
> ok 31
> ok 32
> ok 33
> ok 34
> ok 35 - require() context
> ok 36 - require() context
> ok 37 - require() context
> ok 38 - require() context
> ok 39 - require() context
> ok 40 - require() context
> ok 41 - require() context
> FAILED tests 28-41
>         Failed 14/27 tests, 48.15% okay
> Failed Test    Stat Wstat Total Fail  Failed  List of Failed
> -------------------------------------------------------------------------------
> comp/require.t               27   14  51.85%  28-41
> Failed 1/1 test scripts, 0.00% okay. -14/27 subtests failed, 151.85% okay.

Could somebody please explain why the test harness behaves in this odd
way? Forgetting to update the total number of tests seems to be fairly
common, and I wish we dealt with it more gracefully.

I can understand we need to predeclare the total number of tests... if
some tests at the end fail and produce no output, we wouldn't see them
as failures otherwise.[*]

Having extra "ok"s, however, doesn't seem so terrible; certainly not a
calamity that should cause my harness to complain about 14 of 27 tests
failing.

-- ams

  * I always thought it would be more convenient to post-declare it,
    though. Something like this:

    $i = 0;
    foreach (@tests) {
        # ...
        print "ok ", $i++, "\n";
    }
    print "# Ran $i tests.\n"

    ...would mean I didn't have to keep updating it for each new test.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About