/[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 260 by dpavlin, Fri Dec 16 14:40:55 2005 UTC revision 314 by dpavlin, Fri Dec 23 21:05:50 2005 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use Test::More tests => 74;  use Test::More tests => 76;
4  use Test::Exception;  use Test::Exception;
5  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
6  use blib;  use blib;
# Line 142  ok(my $ds = $n->data_structure( $rec ), Line 142  ok(my $ds = $n->data_structure( $rec ),
142    
143  #diag Dumper($rec, $ds);  #diag Dumper($rec, $ds);
144    
145    # fake load of our test normalisation data
146    $n->{tag} = 'isis';
147    
148    #diag Dumper($n->{import_xml}->{indexer});
149    
150    
151    $rec = {
152     '900' => [
153                {
154                  'a' => '1',
155                  'b' => '2',
156                  'c' => '3',
157                }
158      ],
159    };
160    
161    my $import = {
162            'Tag' => { 'isis' => [
163                            { content => 'v900^a + v900^b = v900^c' },
164            ] },
165    };
166    
167    sub parse_test($$$) {
168            my ($import,$rec,$r) = @_;
169            $n->{import_xml}->{indexer} = $import;
170            # erase internal cache (yak!)
171            delete($n->{tags_by_order});
172            push @{$rec->{'000'}}, 42;
173            diag "test normalisation of: ",Dumper($n->{import_xml}->{indexer}, $rec);
174            ok(my $ds = $n->data_structure( $rec ), "data_structure");
175            diag Dumper($ds);
176            cmp_ok($ds->{Tag}->{display}->[0], 'eq', $r, "parse $r");
177    }
178    
179    parse_test($import, $rec, '1 + 2 = 3');

Legend:
Removed from v.260  
changed lines
  Added in v.314

  ViewVC Help
Powered by ViewVC 1.1.26