wazoox has asked for the wisdom of the Perl Monks concerning the following question:
I've decided to write proper test scripts for the modules I'm developing. I've checked Test::Simple and Test::More, and they're missing a feature that seems important for me : not_ok() function. I need to test that my subs work OK, but it's perhaps at least as important to check that they fail properly when feeded with bad data!
Test::More allows failed tests in a TODO: block, but that's not what I'm looking for.
Does any of you know how I may solve this elegantly?
# this one should work ok( my_sub('needs', 3, 'parameters'), "that's good!"); # this one should fail not_ok(my_sub('bad parameter count'), "that fails!");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test::More : I'd need a "not_ok()" function...
by castaway (Parson) on Oct 14, 2005 at 15:21 UTC | |
by wazoox (Prior) on Oct 14, 2005 at 15:36 UTC | |
|
Re: Test::More : I'd need a "not_ok()" function...
by inman (Curate) on Oct 14, 2005 at 14:41 UTC | |
|
Re: Test::More : I'd need a "not_ok()" function...
by philcrow (Priest) on Oct 14, 2005 at 14:48 UTC | |
by wazoox (Prior) on Oct 14, 2005 at 15:05 UTC | |
by Perl Mouse (Chaplain) on Oct 14, 2005 at 15:25 UTC | |
by philcrow (Priest) on Oct 14, 2005 at 16:01 UTC | |
by bluto (Curate) on Oct 14, 2005 at 16:12 UTC |