/[webpac2]/trunk/t/1-validate-delimiters.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-delimiters.t

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

revision 948 by dpavlin, Sun May 27 11:14:40 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 => 15;  
 use Test::Exception;  
4  use blib;  use blib;
5    
6  use Data::Dump qw/dump/;  use Test::More tests => 15;
7  use Cwd qw/abs_path/;  
8  use File::Temp qw/ :POSIX /;  use File::Temp qw/ :POSIX /;
9    
10  BEGIN {  BEGIN {
11    use_ok( 'WebPAC::Test' );
12  use_ok( 'WebPAC::Validate' );  use_ok( 'WebPAC::Validate' );
13  }  }
14    
 my $debug = shift @ARGV;  
   
 ok(my $abs_path = abs_path($0), "abs_path");  
 $abs_path =~ s#/[^/]*$#/#;  
   
15  my $delimiters_path = tmpnam();  my $delimiters_path = tmpnam();
16    
17  ok(my $v = new WebPAC::Validate(  ok(my $v = new WebPAC::Validate(
18          path => "$abs_path/data/validate_test",          path => "$abs_path/data/validate_test",
19          delimiters => [ ' : ', ' ; ', ' / ', ' \. ', ' = ' ],          delimiters => [ ' : ', ' ; ', ' / ', ' \. ', ' = ' ],
20          delimiters_path => $delimiters_path,          delimiters_path => $delimiters_path,
21          debug => $debug,          %LOG,
22  ), "new");  ), "new");
23    
24  diag "rules = ", dump( $v->{rules} ) if ( $debug );  diag "rules = ", dump( $v->{rules} ) if ( $debug );
# Line 112  ok(my $v2 = new WebPAC::Validate( Line 106  ok(my $v2 = new WebPAC::Validate(
106    
107  is_deeply( $v->{_accumulated_delimiters_templates}, $v2->{_validate_delimiters_templates}, 'save/load ok');  is_deeply( $v->{_accumulated_delimiters_templates}, $v2->{_validate_delimiters_templates}, 'save/load ok');
108    
109  diag dump( $v, $v2 ) if ( $debug );  diag dump( $v, $v2 ) if $debug;

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

  ViewVC Help
Powered by ViewVC 1.1.26