/[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 857 by dpavlin, Sun May 27 16:49:15 2007 UTC revision 858 by dpavlin, Sun May 27 17:09:47 2007 UTC
# Line 17  my $debug = shift @ARGV; Line 17  my $debug = shift @ARGV;
17  ok(my $abs_path = abs_path($0), "abs_path");  ok(my $abs_path = abs_path($0), "abs_path");
18  $abs_path =~ s#/[^/]*$#/#;  $abs_path =~ s#/[^/]*$#/#;
19    
 my $validate_path = "$abs_path/data/validate_test";  
 $validate_path =~ s#//+#/#g;  
   
20  ok(my $v = new WebPAC::Validate(  ok(my $v = new WebPAC::Validate(
21          path => $validate_path,          path => "$abs_path/data/validate_test_simple",
22          debug => $debug,          debug => $debug,
23  ), "new with path");  ), "new with path");
24    
25  ok($v->{rules}, "rules exist");  ok($v->{rules}, "rules exist");
26    
27  is_deeply( $v->{rules}, {  is_deeply( $v->{rules}, {
28          '900' => 1,          '900' => [ 'a', 'b', 'c', 'd' ],
29          '901' => [ 'a' ],  }, 'simple rules parsed');
         '902' => [ 'b', 'c' ],  
         '903' => [ 'a', 'b', 'c' ],  
         '904' => [ 'a' ],  
         '905' => [ 'a*' ],  
 }, 'rules parsed');  
30    
31  ok($v = new WebPAC::Validate(  ok($v = new WebPAC::Validate(
32          debug => $debug,          debug => $debug,
# Line 42  ok($v = new WebPAC::Validate( Line 34  ok($v = new WebPAC::Validate(
34    
35  ok( ! $v->{rules}, 'no path' );  ok( ! $v->{rules}, 'no path' );
36    
37  ok( $v->read_validate_file( $validate_path ), "read_validate_file( $validate_path )" );  ok( $v->read_validate_file( "$abs_path/data/validate_test" ), "read_validate_file" );
38    
39  ok($v->{rules}, "rules exist");  ok($v->{rules}, "rules exist");
40    

Legend:
Removed from v.857  
changed lines
  Added in v.858

  ViewVC Help
Powered by ViewVC 1.1.26