]> Dogcows Code - chaz/p5-CGI-Ex/blob - t/1_validate_03_cgi.t
CGI::Ex 2.32
[chaz/p5-CGI-Ex] / t / 1_validate_03_cgi.t
1 # -*- Mode: Perl; -*-
2
3 =head1 NAME
4
5 1_validate_03_cgi.t - Test CGI::Ex::Fill's ability to interact with CGI.pm.
6
7 =cut
8
9 use strict;
10 use Test::More tests => 3;
11
12 use_ok('CGI::Ex::Validate');
13
14 SKIP: {
15 skip("CGI.pm not installed", 2) if ! eval { require CGI };
16
17 my $form = CGI->new({
18 user => 'abc',
19 pass => '123',
20 });
21 my $val = {
22 user => {
23 required => 1,
24 },
25 pass => {
26 required => 1,
27 },
28 };
29
30 my $err_obj = CGI::Ex::Validate::validate($form,$val);
31 ok(! $err_obj, "Correctly didn't get an error object");
32
33 $form = CGI->new({
34 user => 'abc',
35 #pass => '123',
36 });
37
38 $err_obj = CGI::Ex::Validate::validate($form, $val);
39 ok($err_obj, "Correctly did get an error object");
40
41 }
This page took 0.029217 seconds and 4 git commands to generate.