7 ### determine number of tests
9 my $prog = join "", <DATA>;
10 my @tests = ($prog =~ /&print_ok\(/g);
14 require CGI::Ex::Validate;
16 my ($N, $v, $e, $ok) = (0);
19 return scalar &CGI::Ex::Validate::validate(@_);
24 warn "Test failed at line ".(caller)[2]."\n" if ! $ok;
25 print "" . ($ok ? "" : "not ") . "ok $N\n";
29 ###----------------------------------------------------------------###
31 ### three groups, some with validate_if's
33 'group validate_if' => 'foo',
34 bar => {required => 1},
37 'group validate_if' => 'hem',
38 haw => {required => 1},
41 raspberry => {required => 1},
44 $e = &validate({}, $v);