[Perlunit-devel] Self-testing Perl-Unit file?
Status: Beta
Brought to you by:
mca1001
From: Phlip <pl...@sy...> - 2003-03-04 04:16:46
|
Perlies: I want to write a .pl file like this: sub Subject { # blah blah blah } if (GetOptions('...')) { Subject (options); } else { $results = Subject(test data); assert ($results); } If you call the file with arguments, it does its thing. But if you call the file without arguments, it tests itself, using assert() et al from Test::Unit. The examples for Test::Unit force one to create a module, create a test module, and invoke it in TestRunner by name. Because my testee does not need to be a module, this would add clutter. How minimal can we get? -- Phlip http://flea.sourceforge.net -- Personally qualified to snub Mensa -- |