Re: [PATCH] More Test::More stuff

2001-09-24 Thread Dave Rolsky
On Tue, 25 Sep 2001, Kirrily Robert wrote: > But it does! It says something like: > > not ok 23 > # Failed test 1 (eval.t at line 69) > # got: 'blah blah blah' > # expected: '' Oops, that's what I get for not actually trying it out. I guess that's good enough, though I still l

Re: [PATCH] More Test::More stuff

2001-09-24 Thread Kirrily Robert
In perl.qa, you wrote: >> >> eval { ...code... }; >> is( $@, '' ); > >Yeah, except that doesn't print out $@ in case of failure. If I'm >checking that no exception occurs I want to know what the exception is >when it happens. But it does! It says something like: not ok 23 # Failed

Re: [PATCH] More Test::More stuff

2001-09-24 Thread Dave Rolsky
On Mon, 24 Sep 2001, Michael G Schwern wrote: > On Mon, Sep 24, 2001 at 06:42:55PM -0500, Dave Rolsky wrote: > > +sub eval_ok (&$) { > > +my ($code, $name) = @_; > > + > > +eval { $code->() }; > > +if ($@) { > > + ok( 0, "$name - $@" ); > > +} else { > > + ok( 1, $name ); > >

Re: [PATCH] More Test::More stuff

2001-09-24 Thread Michael G Schwern
On Mon, Sep 24, 2001 at 06:42:55PM -0500, Dave Rolsky wrote: > +sub eval_ok (&$) { > +my ($code, $name) = @_; > + > +eval { $code->() }; > +if ($@) { > + ok( 0, "$name - $@" ); > +} else { > + ok( 1, $name ); > +} > +} The unfortunate problem is this has adverse effect

[PATCH] More Test::More stuff

2001-09-24 Thread Dave Rolsky
Ok, forget the last patch. This one incorporates that plus more. This one also adds an eval_ok function. The idea here is that sometimes you simply want to try something to see if it works or not. If it fails it will append the error ($@) after the name of the test. The reason for these patch