Syntactic Confectionery Delight | |
PerlMonks |
perlman:lib:Testby root (Monk) |
on Dec 23, 1999 at 00:49 UTC ( [id://1129]=perlfunc: print w/replies, xml ) | Need Help?? |
lib:TestSee the current Perl documentation for lib:Test. Here is our local, out-dated (pre-5.6) version:
Test - provides a simple framework for writing test scripts
use strict; use Test; BEGIN { plan tests => 13, todo => [3,4] }
ok(0); # failure ok(1); # success
ok(0); # ok, expected failure (see todo list, above) ok(1); # surprise success! Test::Harness expects to see particular output when it executes tests. This module aims to make writing proper test scripts just a little bit easier (and less error prone :-).
TEST TYPES
ONFAIL
BEGIN { plan test => 4, onfail => sub { warn "CALL 911!" } }
The test failures can trigger extra diagnostics at the end of the test run.
This optional feature might be used simply to print out the version of your
package and/or how to report problems. It might also be used to generate
extremely sophisticated diagnostics for a particular test failure. It's not
a panacea, however. Core dumps or other unrecoverable errors will prevent
the
SEE ALSOTest::Harness and various test coverage analysis tools.
AUTHORCopyright (C) 1998 Joshua Nathaniel Pritikin. All rights reserved. This package is free software and is provided ``as is'' without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html) |
|