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 ###----------------------------------------------------------------###
39 $e = &validate({}, $v);
41 $e = &validate({user => 1}, $v);
43 $e = &validate({user => 1, bar => 1}, $v);
45 $e = &validate({user => 1, bar => 1, foo => 1}, $v);
49 ### three groups, some with validate_if's - using arrayref
51 - group validate_if: foo
54 - group validate_if: hem
60 $e = &validate({}, $v);
99 ### three groups, some with validate_if's - using documents
101 group validate_if: foo
105 group validate_if: hem
112 $e = &validate({}, $v);