Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Testing programs

by sauoq (Abbot)
on Oct 25, 2005 at 13:05 UTC ( #502694=note: print w/replies, xml ) Need Help??


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.";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://502694]
help
Chatterbox?
[erix]: I guess I'll stare it down in the end but I'm already staring for a while... :)
[erix]: btw, I had a typo in there, so reload (if anyone is looking)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2018-01-19 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (216 votes). Check out past polls.

    Notices?