http://qs321.pair.com?node_id=502694


in reply to Testing programs

Why use a command line argument for testing? I sometimes stick my tests in a separate file and do() them when I want to.

In my program...

#!/usr/bin/perl use warnings; use strict; do "tests.pl"; sub foo { "foo" }
And then in tests.pl ...
use Test::Simple tests => 1; ok( foo() eq 'foo' ); exit;

Then I can just comment out my do "tests.pl"; line when I'm done with it.

-sauoq
"My two cents aren't worth a dime.";