Added corner tests for empty string and undef.

Converted tests to handle skipping if the macro can't be loaded.
This commit is contained in:
Colin Kuskie 2006-07-30 07:39:49 +00:00
parent 818ab4a690
commit 78c33c54ff
5 changed files with 81 additions and 10 deletions

View file

@ -53,12 +53,30 @@ my @testSets = (
my $numTests = scalar @testSets;
plan tests => $numTests + 2;
$numTests += 1; ##use_ok
$numTests += 1; ##testBlock has no name collisions
$numTests += 3; ##TODO block
use_ok('WebGUI::Macro::FormParam');
plan tests => $numTests;
my $macro = 'WebGUI::Macro::FormParam';
my $loaded = use_ok($macro);
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
auto_check($session, \@testSets);
}
TODO: {
local $TODO = "Tests to write later";
ok(0, "What will this do with a non-existant form param?");
ok(0, "Also try null");
ok(0, "Also try undef");
}
sub auto_check {
my ($session, $testBlock) = @_;
my $origSessionRequest = $session->{_request};