/[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 948 by dpavlin, Mon Oct 29 22:49:46 2007 UTC revision 949 by dpavlin, Thu Nov 1 00:16:48 2007 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
 use Test::More tests => 54;  
 use Test::Exception;  
4  use blib;  use blib;
5    
6  use Data::Dump qw/dump/;  use Test::More tests => 54;
 use Cwd qw/abs_path/;  
7    
8  BEGIN {  BEGIN {
9    use_ok( 'WebPAC::Test' );
10  use_ok( 'WebPAC::Validate' );  use_ok( 'WebPAC::Validate' );
11  }  }
12    
13  my $debug = shift @ARGV;  ok(my $v = new WebPAC::Validate(%LOG), "new witout path");
   
 ok(my $abs_path = abs_path($0), "abs_path");  
 $abs_path =~ s#/[^/]*$#/#;  
   
 ok(my $v = new WebPAC::Validate(  
         debug => $debug,  
 ), "new witout path");  
14    
15  ok( ! $v->{rules}, 'no path' );  ok( ! $v->{rules}, 'no path' );
16    
17  ok($v = new WebPAC::Validate(  ok($v = new WebPAC::Validate(
18          path => "$abs_path/data/validate_test",          path => "$abs_path/data/validate_test",
19          debug => $debug,          %LOG,
20  ), "new with path");  ), "new with path");
21    
22  ok($v->{rules}, "rules exist");  ok($v->{rules}, "rules exist");
# Line 89  sub test_v { Line 80  sub test_v {
80                          if (ref($tmp) eq 'HASH') {                          if (ref($tmp) eq 'HASH') {
81                                  return $tmp;                                  return $tmp;
82                          } else {                          } else {
83                                  diag "explanation: $tmp";                                  diag "explanation: $tmp" if $debug;
84                          }                          }
85                  }                  }
86          } else {          } else {

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

  ViewVC Help
Powered by ViewVC 1.1.26