Buddy Burden schrieb am 30.03.2011 um 11:25 (-0700): > On Wed, Mar 30, 2011 at 5:58 AM, Ovid <publiustemp-perl...@yahoo.com> wrote:
> >> perl -le 'use Test::More tests => 2; ok(1) or die; ok(1);' > >> perl -le 'use Test::More tests => 2; ok(0) or die; ok(1);' > Plus, with the "or die" approach, you can only mimic Test::Most's "die > on fail" capability, whereas the "bail on fail" capability is far more > useful, IMHO. Plus plus, with the "or die" approach, you're _always_ > dying on fail. With Test::Most, you can activate that by changing one > line of code, or (even better) by setting an environment variable and > not changing any code at all. Plus plus plus, it's as clear and plain as a domain-specific language, as in this contrived case: bail_on_fail; lives_ok { $dbh = $env->get_connection } 'get database connection'; # every script in this suite needs the database die_on_fail; ok $network->is_reachable, 'no net, no action'; # next script works locally, so we don't have to bail out > > At this point, I would suggest that Test::More might be for code > > that you put on the CPAN (assuming you don't want to force > > dependencies on people), but I'd never want to do without Test::Most > > for personal code. > > Agree 100%. I'm adding another 100%. -- Michael Ludwig