develooper Front page | perl.perl5.porters | Postings from September 2005

Re: [TODO] rewrite Math::Complex' Complex.t to use Test::More

Thread Previous
From:
Michael G Schwern
Date:
September 25, 2005 22:23
Subject:
Re: [TODO] rewrite Math::Complex' Complex.t to use Test::More
Message ID:
20050926052355.GA22124@windhund.schwern.org
On Mon, Sep 26, 2005 at 08:04:09AM +0300, Jarkko Hietaniemi wrote:
> What I would want to see in case of failures would be e.g.
> 
> not ok 123
> #   Failed test in Complex.t at line 56, <DATA> line 1234.
> #          got: '1+2i'
> #     expected: '1+i'
> 
> because the relevant input data would be at 1234, not at 56.

Simplest thing to do is add that info as extra diagnostics.

	is( $foo, $bar ) or diag("<DATA> line $.");

A better way would be to override Test::Builder's default caller diagnostics,
but its not really flexible enough yet to do that.


PS  Complex.t appears to be building a big @script and evaling it.  Why?


-- 
Michael G Schwern     schwern@pobox.com     http://www.pobox.com/~schwern
You know what the chain of command is? It's the chain I go get and beat you 
with 'til you understand who's in ruttin' command here. 
        -- Jayne Cobb, "Firefly"

Thread Previous


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