X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=t%2F1_validate_00_base.t;h=12a1b0c2a5d57d8359f204e97c710ae9ac4d5b6e;hp=d8ea8df2bc7eb3a2dbcb7d89806273301f2e56fa;hb=4eee158dce82376f2f37de29d91c53f60a24aebe;hpb=85070b46d0a93ddbeef07341421adb8389a55418 diff --git a/t/1_validate_00_base.t b/t/1_validate_00_base.t index d8ea8df..12a1b0c 100644 --- a/t/1_validate_00_base.t +++ b/t/1_validate_00_base.t @@ -1,8 +1,39 @@ +# -*- 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");