Test::Unit.pm unit testing framework
By: Keith Watanabe
Published On: 9-27-2005
this is a nice, little framework that you can use for building either OOP or scripted tests. the basics: use Test::Unit::Procedural; create_suite(); run_suite(); sub test_comparison { $a = 1; $b = 1; $c = 2; print "$a == $b\n"; assert($a == $b); print "$b == $c\n"; assert($b == $c\n"; } this will create a test suite based on subroutines you define here. the most important elements are the "assert" function calls which test for boolean cases. if a test fails, the script will die. i like this because it does exactly what you need and can be used to test in bulk large numbers of things like data objects, etc.
Post Comment
Trackbacks: (Trackback URL)
No Comments Posted Yet
