X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=t%2F1_validate_07_yaml.t;fp=t%2F1_validate_07_yaml.t;h=9c3c9a631f7dbdd82178b2c58430d3efa87162c9;hp=7dc54c74e3f18a86d3b5e5cd8ecb35f51b47f6ef;hb=f30b8252fcf71659a2fd3b5895e009ff8e39299d;hpb=8a1796477c5a835d8c124cfa8504909dc786d93b diff --git a/t/1_validate_07_yaml.t b/t/1_validate_07_yaml.t index 7dc54c7..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 => 17; +use Test::More tests => 5; SKIP: { -skip("Missing YAML.pm", 17) if ! eval { require 'YAML.pm' }; +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 +};