X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=t%2F1_validate_07_yaml.t;h=9c3c9a631f7dbdd82178b2c58430d3efa87162c9;hb=HEAD;hp=12d1c1fdee2b587fff07da64d684306d53a253c8;hpb=4eee158dce82376f2f37de29d91c53f60a24aebe;p=chaz%2Fp5-CGI-Ex diff --git a/t/1_validate_07_yaml.t b/t/1_validate_07_yaml.t index 12d1c1f..9c3c9a6 100644 --- a/t/1_validate_07_yaml.t +++ b/t/1_validate_07_yaml.t @@ -7,11 +7,11 @@ =cut use strict; -use Test::More tests => 15; +use Test::More tests => 5; SKIP: { -skip("Missing YAML.pm", 15) if ! eval { require 'YAML' }; +skip("Missing YAML.pm", 5) if ! eval { require 'YAML.pm' }; use_ok('CGI::Ex::Validate'); @@ -41,105 +41,4 @@ $e = validate({user => 1, bar => 1, foo => 1}, $v); ok(! $e); -### three groups, some with validate_if's - using arrayref -$v = ' -- group validate_if: foo - bar: - required: 1 -- group validate_if: hem - haw: { required: 1 } -- raspberry: - required: 1 -'; - -$e = validate({}, $v); -ok($e); - -$e = validate({ - raspberry => 'tart', -}, $v); -ok(! $e); - -$e = validate({ - foo => 1, - raspberry => 'tart', -}, $v); -ok($e); - -$e = validate({ - foo => 1, - bar => 1, - raspberry => 'tart', -}, $v); -ok(! $e); - -$e = validate({ - foo => 1, - bar => 1, - hem => 1, - raspberry => 'tart', -}, $v); -ok($e); - -$e = validate({ - foo => 1, - bar => 1, - hem => 1, - haw => 1, - raspberry => 'tart', -}, $v); -ok(! $e); - - -### three groups, some with validate_if's - using documents -$v = '--- -group validate_if: foo -bar: - required: 1 ---- -group validate_if: hem -haw: { required: 1 } ---- -raspberry: - required: 1 -'; - -$e = validate({}, $v); -ok($e); - -$e = validate({ - raspberry => 'tart', -}, $v); -ok(! $e); - -$e = validate({ - foo => 1, - raspberry => 'tart', -}, $v); -ok($e); - -$e = validate({ - foo => 1, - bar => 1, - raspberry => 'tart', -}, $v); -ok(! $e); - -$e = validate({ - foo => 1, - bar => 1, - hem => 1, - raspberry => 'tart', -}, $v); -ok($e); - -$e = validate({ - foo => 1, - bar => 1, - hem => 1, - haw => 1, - raspberry => 'tart', -}, $v); -ok(! $e); - -} # end of SKIP +};