r932@llin: dpavlin | 2006-09-11 14:31:51 +0200
[webpac2] / t / 1-validate.t
index 05728cb..3187c38 100755 (executable)
@@ -21,6 +21,7 @@ throws_ok { new WebPAC::Validate( no_log => 1 ) } qr/need path/, "new without pa
 
 ok(my $v = new WebPAC::Validate(
        path => "$abs_path/data/validate_test",
+       debug => $debug,
 ), "new");
 
 ok($v->{rules}, "rules exist");
@@ -73,7 +74,7 @@ sub test_v {
 
 test_v({
        '900' => 'foo'
-}, qw/field 900 not_repeatable/);
+}, qw/900 not_repeatable/);
 
 test_v({
        '900' => [ qw/foo bar baz/ ]
@@ -81,7 +82,7 @@ test_v({
 
 test_v({
        '901' => [ qw/foo bar baz/ ]
-}, qw/field 901 missing_subfield/);
+}, qw/901 missing_subfield/);
 
 test_v({
        '901' => [ { 'a' => 42 } ]
@@ -89,7 +90,7 @@ test_v({
 
 test_v({
        '901' => [ { 'b' => 42 } ]
-}, qw/field 901 subfield extra b/);
+}, qw/901 subfield extra b/);
 
 test_v({
        '902' => [ { 'b' => 1 }, { 'c' => 2 } ]
@@ -97,7 +98,7 @@ test_v({
 
 test_v({
        '902' => [ { 'a' => 0 }, { 'b' => 1 }, { 'c' => 2 } ]
-}, qw/field 902 subfield extra a/);
+}, qw/902 subfield extra a/);
 
 test_v({
        '903' => [ { 'a' => 0 }, { 'b' => 1 }, { 'c' => 2 } ]
@@ -105,13 +106,13 @@ test_v({
 
 test_v({
        '903' => [ { 'a' => 0 }, { 'b' => 1 }, { 'c' => 2 }, { 'd' => 3 } ]
-}, qw/field 903 subfield extra d/);
+}, qw/903 subfield extra d/);
 
 is_deeply(
 
 test_v({
        '903' => [ { 'a' => 0 }, { 'b' => 1 }, { 'c' => 2 }, { 'd' => 3 }, { 'e' => 4 } ]
-}, qw/field 903 subfield extra/),
+}, qw/903 subfield extra/),
 { 'd' => 1, 'e' => 1 }, 'additional fields d, e');
 
 test_v({
@@ -120,11 +121,11 @@ test_v({
 
 test_v({
        '904' => [ { 'b' => 1 } ]
-}, qw/field 904 subfield extra b/);
+}, qw/904 subfield extra b/);
 
 test_v({
        '904' => [ { 'a' => [ 1,2 ] } ]
-}, qw/field 904 subfield extra_repeatable a/);
+}, qw/904 subfield extra_repeatable a/);
 
 test_v({
        '905' => [ { 'a' => [ 1,2 ] } ]
@@ -145,4 +146,4 @@ test_v({
 
 diag "errors: ",dump( $v->all_errors );
 
-print $v->report;
+diag "report: ", $v->report;