+# -*- Mode: Perl; -*-
-BEGIN {
- print "1..1\n";
-}
+=head1 NAME
-use CGI::Ex::Validate;
+1_validate_00_base.t - Test CGI::Ex::Validate's ability to compile and execute
-BEGIN { print "ok 1\n"; }
+=cut
+
+use strict;
+use Test::More tests => 3;
+
+use_ok('CGI::Ex::Validate');
+
+my $form = {
+ user => 'abc',
+ pass => '123',
+};
+my $val = {
+ user => {
+ required => 1,
+ },
+ pass => {
+ required => 1,
+ },
+};
+
+my $err_obj = CGI::Ex::Validate::validate($form, $val);
+ok(! $err_obj, "Basic function works");
+
+###----------------------------------------------------------------###
+
+$form = {
+ user => 'abc',
+# pass => '123',
+};
+
+$err_obj = CGI::Ex::Validate::validate($form,$val);
+
+ok($err_obj, "Successfully failed");