r1636@llin: dpavlin | 2007-11-19 17:49:11 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 19 Nov 2007 16:50:12 +0000 (16:50 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 19 Nov 2007 16:50:12 +0000 (16:50 +0000)
 expose bug with subfield 0 in validation

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1050 07558da8-63fa-0310-ba24-9fe276d99e06

t/1-validate.t
t/data/validate_test

index 8fedbd9..734d274 100755 (executable)
@@ -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" },
index a35ad7a..69bd68b 100644 (file)
@@ -8,3 +8,4 @@
 903 a b c
 904 a!
 905 a*
+906 0