r1670@llin: dpavlin | 2007-11-28 00:13:29 +0100
[webpac2] / t / 1-validate.t
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" },