/[webpac2]/trunk/t/1-validate.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/1-validate.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 949 by dpavlin, Thu Nov 1 00:16:48 2007 UTC revision 1050 by dpavlin, Mon Nov 19 16:50:12 2007 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 54;  use Test::More tests => 56;
7    
8  BEGIN {  BEGIN {
9  use_ok( 'WebPAC::Test' );  use_ok( 'WebPAC::Test' );
# Line 28  is_deeply( $v->{rules}, { Line 28  is_deeply( $v->{rules}, {
28          '903' => [ 'a', 'b', 'c' ],          '903' => [ 'a', 'b', 'c' ],
29          '904' => [ 'a' ],          '904' => [ 'a' ],
30          '905' => [ 'a*' ],          '905' => [ 'a*' ],
31            '906' => [ '0' ],
32  }, 'simple rules parsed');  }, 'simple rules parsed');
33    
34  diag dump( $v ) if ( $debug );  diag dump( $v ) if ( $debug );
# Line 51  is_deeply( $v->{rules}, { Line 52  is_deeply( $v->{rules}, {
52          '903' => [ 'a', 'b', 'c' ],          '903' => [ 'a', 'b', 'c' ],
53          '904' => [ 'a' ],          '904' => [ 'a' ],
54          '905' => [ 'a*' ],          '905' => [ 'a*' ],
55            '906' => [ '0' ],
56  }, 'rules');  }, 'rules');
57    
58  ok($v->{rules}, "rules exist");  ok($v->{rules}, "rules exist");
# Line 152  test_v({ Line 154  test_v({
154          '905' => [ ]          '905' => [ ]
155  });  });
156    
157    test_v({
158            '906' => [ ]
159    });
160    
161    test_v({
162            '906' => [ { '0' => 'foo' } ]
163    });
164    
165  my $expected_error = {  my $expected_error = {
166     900 => { not_repeatable => "probably bug in parsing input data" },     900 => { not_repeatable => "probably bug in parsing input data" },
167     901 => { missing_subfield => "a required", "dump" => "baz" },     901 => { missing_subfield => "a required", "dump" => "baz" },

Legend:
Removed from v.949  
changed lines
  Added in v.1050

  ViewVC Help
Powered by ViewVC 1.1.26