/[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 827 by dpavlin, Sun May 20 16:19:16 2007 UTC revision 828 by dpavlin, Sun May 20 16:19:17 2007 UTC
# Line 19  $abs_path =~ s#/[^/]*$#/#; Line 19  $abs_path =~ s#/[^/]*$#/#;
19    
20  ok(my $v = new WebPAC::Validate(  ok(my $v = new WebPAC::Validate(
21          path => "$abs_path/data/validate_test",          path => "$abs_path/data/validate_test",
22          delimiters => [ ' : ', ' ; ', ' / ', ' \. ' ],          delimiters => [ ' : ', ' ; ', ' / ', ' \. ', ' = ' ],
23          debug => $debug,          debug => $debug,
24  ), "new");  ), "new");
25    
# Line 41  sub test_v { Line 41  sub test_v {
41  }  }
42    
43  test_v({  test_v({
44          '900' => [ { 'a' => 'a : aa = aaa : a ; a', 'b' => 'b ; b ; b ; b ; a : / z . z . ' }, { 'c' => 'a : b ; c / d' } ]          '900' => [
45                    { 'a' => 'a : aa = aaa : a ; a', 'b' => 'b ; b ; b ; b ; a : / z . z . ' },
46                    { 'a' => 'a : a : a', 'c' => [ 'a : b ; c', 'a : b ; c / d' ] },
47                    { 'a' => 'a : b / c' },
48                    { 'a' => 'a : b / c' },
49            ]
50  });  });
51    
52  diag dump($v->{_delimiters_templates});  diag dump($v->{_delimiters_templates});
53    
54  is_deeply( $v->{_delimiters_templates}, {  is_deeply( $v->{_delimiters_templates}, {
55          900 => {          900 => {
56                  "^a :  :  ; ^b ;  ;  ;  ;  :  .  . "            => 1,                  "^a :  / " => 2,
57                  "^a :  :  ; ^b ;  ;  ;  ;  :  .  . ^c :  ;  / " => 1,                  "^a :  : ^c :  ; ^c :  ;  / " => 1,
58                    "^a :  =  :  ; ^b ;  ;  ;  ;  :  .  . " => 1,
59          },          },
60  }, 'just subfields and delimiters');  }, 'just subfields and delimiters');
61    

Legend:
Removed from v.827  
changed lines
  Added in v.828

  ViewVC Help
Powered by ViewVC 1.1.26