/[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 836 by dpavlin, Thu May 24 10:53:50 2007 UTC revision 837 by dpavlin, Thu May 24 12:44:45 2007 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
4  use Test::More tests => 7;  use Test::More tests => 10;
5  use Test::Exception;  use Test::Exception;
6  use blib;  use blib;
7    
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
10    use File::Temp qw/tempfile/;
11    
12  BEGIN {  BEGIN {
13  use_ok( 'WebPAC::Validate' );  use_ok( 'WebPAC::Validate' );
# Line 17  my $debug = shift @ARGV; Line 18  my $debug = shift @ARGV;
18  ok(my $abs_path = abs_path($0), "abs_path");  ok(my $abs_path = abs_path($0), "abs_path");
19  $abs_path =~ s#/[^/]*$#/#;  $abs_path =~ s#/[^/]*$#/#;
20    
21    my ( $fh, $path ) = tempfile();
22    
23  ok(my $v = new WebPAC::Validate(  ok(my $v = new WebPAC::Validate(
24          path => "$abs_path/data/validate_test",          path => "$abs_path/data/validate_test",
25          delimiters => [ ' : ', ' ; ', ' / ', ' \. ', ' = ' ],          delimiters => [ ' : ', ' ; ', ' / ', ' \. ', ' = ' ],
26            delimiters_path => $path,
27          debug => $debug,          debug => $debug,
28  ), "new");  ), "new");
29    
# Line 87  ok (my $e = $v->report, 'report'); Line 91  ok (my $e = $v->report, 'report');
91    
92  diag $e;  diag $e;
93  diag dump( $v->{errors} );  diag dump( $v->{errors} );
94    
95    ok( $v->save_delimiters_templates, 'save_delimiters_templates' );
96    
97    ok(my $v2 = new WebPAC::Validate(
98            delimiters => [ ' : ', ' ; ', ' / ', ' \. ', ' = ' ],
99            delimiters_path => $path,
100            debug => $debug,
101    ), "new");
102    
103    is_deeply( $v->{_delimiters_templates}, $v2->{_validate_delimiters_templates}, 'save/load ok');

Legend:
Removed from v.836  
changed lines
  Added in v.837

  ViewVC Help
Powered by ViewVC 1.1.26