From: Dobrica Pavlinusic Date: Mon, 19 Nov 2007 16:50:12 +0000 (+0000) Subject: r1636@llin: dpavlin | 2007-11-19 17:49:11 +0100 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=cf7feacf35d34d09de185805785470e37472c01d;p=webpac2 r1636@llin: dpavlin | 2007-11-19 17:49:11 +0100 expose bug with subfield 0 in validation git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1050 07558da8-63fa-0310-ba24-9fe276d99e06 --- diff --git a/t/1-validate.t b/t/1-validate.t index 8fedbd9..734d274 100755 --- a/t/1-validate.t +++ b/t/1-validate.t @@ -3,7 +3,7 @@ use strict; use blib; -use Test::More tests => 54; +use Test::More tests => 56; BEGIN { use_ok( 'WebPAC::Test' ); @@ -28,6 +28,7 @@ is_deeply( $v->{rules}, { '903' => [ 'a', 'b', 'c' ], '904' => [ 'a' ], '905' => [ 'a*' ], + '906' => [ '0' ], }, 'simple rules parsed'); diag dump( $v ) if ( $debug ); @@ -51,6 +52,7 @@ is_deeply( $v->{rules}, { '903' => [ 'a', 'b', 'c' ], '904' => [ 'a' ], '905' => [ 'a*' ], + '906' => [ '0' ], }, 'rules'); ok($v->{rules}, "rules exist"); @@ -152,6 +154,14 @@ test_v({ '905' => [ ] }); +test_v({ + '906' => [ ] +}); + +test_v({ + '906' => [ { '0' => 'foo' } ] +}); + my $expected_error = { 900 => { not_repeatable => "probably bug in parsing input data" }, 901 => { missing_subfield => "a required", "dump" => "baz" }, diff --git a/t/data/validate_test b/t/data/validate_test index a35ad7a..69bd68b 100644 --- a/t/data/validate_test +++ b/t/data/validate_test @@ -8,3 +8,4 @@ 903 a b c 904 a! 905 a* +906 0