r929@llin: dpavlin | 2006-09-11 13:56:02 +0200
[webpac2] / t / 1-validate.t
index 68ad24c..05728cb 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use Test::More tests => 50;
+use Test::More tests => 51;
 use Test::Exception;
 use blib;
 
@@ -112,7 +112,6 @@ is_deeply(
 test_v({
        '903' => [ { 'a' => 0 }, { 'b' => 1 }, { 'c' => 2 }, { 'd' => 3 }, { 'e' => 4 } ]
 }, qw/field 903 subfield extra/),
-
 { 'd' => 1, 'e' => 1 }, 'additional fields d, e');
 
 test_v({
@@ -134,3 +133,16 @@ test_v({
 test_v({
        '905' => [ ]
 });
+
+test_v({
+       '900' => 'foo',
+       '901' => [ qw/foo bar baz/ ],
+       '902' => [ { 'a' => 1, 'b' => [ 1,2 ] } ],
+       '903' => [ { 'a' => [ 1, 2 ], 'c' => 1, } ],
+       '904' => [ { 'b' => 1 } ],
+       '905' => [ { 'a' => 1 } ],
+});
+
+diag "errors: ",dump( $v->all_errors );
+
+print $v->report;