/[webpac2]/trunk/t/3-normalize-xml.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/3-normalize-xml.t

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

revision 362 by dpavlin, Sun Jan 8 20:27:01 2006 UTC revision 365 by dpavlin, Sun Jan 8 20:27:16 2006 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use Test::More tests => 124;  use Test::More tests => 132;
4  use Test::Exception;  use Test::Exception;
5  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
6  use blib;  use blib;
# Line 171  sub parse_test($$$$$) { Line 171  sub parse_test($$$$$) {
171          push @{$rec->{'000'}}, 42 unless ($rec->{'000'});          push @{$rec->{'000'}}, 42 unless ($rec->{'000'});
172          #diag "test normalisation of: ",Dumper($n->{import_xml}->{indexer}, $rec);          #diag "test normalisation of: ",Dumper($n->{import_xml}->{indexer}, $rec);
173          ok(my $ds = $n->data_structure( $rec ), "data_structure");          ok(my $ds = $n->data_structure( $rec ), "data_structure");
174          #diag Dumper($ds);          diag Dumper($ds) if ($i == 0);
175          cmp_ok($ds->{$tag}->{display}->[$i], 'eq', $r, "parse $tag/$i - $r");          cmp_ok($ds->{$tag}->{display}->[$i], 'eq', $r, "parse $tag/$i - $r");
176  }  }
177    
# Line 245  my $import = { Line 245  my $import = {
245          'Tag_x' => { 'isis' => [          'Tag_x' => { 'isis' => [
246                  { content => 'v900^x' },                  { content => 'v900^x' },
247          ] },          ] },
248            'Tag_s1' => { 'isis' => [
249                    { content => 's900^b = s900^x' },
250            ] },
251            'Tag_s2' => { 'isis' => [
252                    { content => 's900^a s900^b s900^c s900^x' },
253            ] },
254  };  };
255    
256  parse_test_arr($import, 'Tag_a', $rec, [ '','a1','','a2' ] );  parse_test_arr($import, 'Tag_a', $rec, [ '','a1','','a2' ] );
257  parse_test_arr($import, 'Tag_b', $rec, [ 'b1','b2','b3','b4' ] );  parse_test_arr($import, 'Tag_b', $rec, [ 'b1','b2','b3','b4' ] );
258  parse_test_arr($import, 'Tag_c', $rec, [ '','','c1','c2' ] );  parse_test_arr($import, 'Tag_c', $rec, [ '','','c1','c2' ] );
259  parse_test_arr($import, 'Tag_x', $rec, [ 'b1','a1_b2','b3_c1','a2_b4_c2' ] );  parse_test_arr($import, 'Tag_x', $rec, [ 'b1','a1_b2','b3_c1','a2_b4_c2' ] );
260    parse_test_arr($import, 'Tag_s1', $rec, [ 'b1 = b1', 'b1 = b1', 'b1 = b1', 'b1 = b1' ] );
261    

Legend:
Removed from v.362  
changed lines
  Added in v.365

  ViewVC Help
Powered by ViewVC 1.1.26