develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [PATCH t/op/pack.t pod/perlhack.pod] Adding the failurediagnostic (was Re: [PATCH pod/perlhack.pod t/op/pack.t] Fixing badtesting advice)

Thread Previous | Thread Next
From:
Arthur Bergman
Date:
August 28, 2001 07:03
Subject:
Re: [PATCH t/op/pack.t pod/perlhack.pod] Adding the failurediagnostic (was Re: [PATCH pod/perlhack.pod t/op/pack.t] Fixing badtesting advice)
Message ID:
B7B17126.35CF%arthur@contiller.se
01-08-28 15.57, skrev Michael G Schwern på schwern@pobox.com följande:

> On Tue, Aug 28, 2001 at 02:25:06PM +0100, Nicholas Clark wrote:
>> Another would be to make a small ok function from something that can be
>> cut&pasted into any of the core perl tests (ie stuff before lib/)
> 
> God, you're, like, *SO* last night. ;) I already did this, it's in
> perlhack.
> 
> 
>> Something that will issue a comment using caller() to find the line number
>> of the failing test, and let the user pass in names for the tests.
> 
> I'll patch this in.
> 
> --- t/op/pack.t 2001/08/28 13:54:46 1.1
> +++ t/op/pack.t 2001/08/28 13:55:52
> @@ -19,6 +19,8 @@
> $out .= "ok $test\n";
> print $out;
> 
> +    printf "# Failed test at line %d\n", (caller)[2] unless $ok;
> +
> $test++;
> return $ok;
> }
> --- pod/perlhack.pod 2001/08/28 13:54:34 1.1
> +++ pod/perlhack.pod 2001/08/28 13:55:17
> @@ -1489,6 +1489,8 @@
> $out .= "ok $test\n";
> print $out;
> 
> +        printf "# Failed test at line %d\n", (caller)[2] unless $ok;
> +
> $test++;
> return $ok;
> }
> 
> 
> 
Applied! Thanks.

-- 
Arthur


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