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

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

Thread Previous
Michael G Schwern
September 25, 2005 22:23
Re: [TODO] rewrite Math::Complex' Complex.t to use Test::More
Message ID:
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
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About