develooper Front page | perl.qa | Postings from January 2010

Test::Most improvement?

Thread Next
From:
Ovid
Date:
January 31, 2010 23:40
Subject:
Test::Most improvement?
Message ID:
987507.27156.qm@web65704.mail.ac4.yahoo.com
Test::Most was written because I was tired of seeing boilerplate code like:

    use strict;
    use warnings;
    use Test::More tests => 23;
    use Test::Exception;
    use Test::Differences;

So now it's down to this:

    use strict;
    use warnings;
    use Test::Most tests => 23;
But I'm thinking about going one step further and hitting the Modern::Perl-like road:

    use Test::More tests => 23;

Just use that line and you get strict and warnings, plus the most popular testing modules.  I don't remember the last time I saw a modern test program without strict and warnings.  Would it be a good idea to automatically turn them on?  I know that there are a few people who won't like it, but they won't have to write any more lines of code. They could just write:

    use Test::More tests => 23;
    no strict;
    no warnings;

Heck, I could argue that I'm saving them two characters :) (not to mention the fact that I'd be forcing them to be explicit that they didn't *forget* strict and warnings)

Thoughts?
Curtis--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6



Thread Next


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