/[Biblio-Isis]/trunk/t/002_isis.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/002_isis.t

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

revision 46 by dpavlin, Fri Jul 7 10:25:02 2006 UTC revision 49 by dpavlin, Fri Jul 7 21:07:44 2006 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 110;  use Test::More tests => 112;
7  use File::Spec;  use File::Spec;
8    
 my $emulate_dump = 0;  
   
9  BEGIN {  BEGIN {
10          use_ok( 'Biblio::Isis' );          use_ok( 'Biblio::Isis' );
11          eval "use Data::Dump";          eval "use Data::Dump";
# Line 103  sub test_data { Line 101  sub test_data {
101                  '10' => [ '^a0-340-59691-0' ],                  '10' => [ '^a0-340-59691-0' ],
102          }, {          }, {
103                  # identifier test                  # identifier test
                 '225' => [ '1#^aMcGraw-Hill series in Psychology' ],  
104                  '200' => [ '1#^aPsychology^fCamille B. Wortman, Elizabeth F. Loftus, Mary E. Marshal' ],                  '200' => [ '1#^aPsychology^fCamille B. Wortman, Elizabeth F. Loftus, Mary E. Marshal' ],
105                    225 => ["1#^aMcGraw-Hill series in Psychology"],
106                    205 => ["^a4th ed"],
107          } ];          } ];
108                                    
109          foreach my $mfn (1 .. $isis->count) {          foreach my $mfn (1 .. $isis->count) {
110    
                 diag "row: ",Dumper( $data->[$mfn-1] );  
   
111                  my $rec;                  my $rec;
112                  ok($rec = $isis->fetch($mfn), "fetch $mfn");                  ok($rec = $isis->fetch($mfn), "fetch $mfn");
113    
114                  diag "rec: ",Dumper( $rec );  
115                    diag "<<<<< rec: ",Dumper( $rec ), "\n>>>>> row:", Dumper( $data->[$mfn-1] );
116    
117                  foreach my $f (keys %{$data->[$mfn-1]}) {                  foreach my $f (keys %{$data->[$mfn-1]}) {
118                          my $i = 0;                          my $i = 0;
119                          foreach my $v (@{$data->[$mfn-1]->{$f}}) {                          foreach my $v (@{$data->[$mfn-1]->{$f}}) {
120                                  $v =~ s/^[01# ][01# ]// if ($args->{no_ident});                                  $v =~ s/^[01# ][01# ]// if ($args->{no_ident});
121                                  cmp_ok($v, 'eq', $rec->{$f}->[$i], "MFN $mfn $f:$i $v");                                  diag "compare '", $rec->{$f}->[$i], "' eq '$v'" if ($debug);
122                                    cmp_ok($rec->{$f}->[$i], 'eq', $v, "MFN $mfn field: $f offset: $i");
123                                  $i++;                                  $i++;
124                          }                          }
125                  }                  }
# Line 156  test_data( Line 155  test_data(
155                  4fb38537a94f3f5954e40d9536b942b0                  4fb38537a94f3f5954e40d9536b942b0
156                  579a7c6901c654bdeac10547a98e5b71                  579a7c6901c654bdeac10547a98e5b71
157                  7d2adf1675c83283aa9b82bf343e3d85                  7d2adf1675c83283aa9b82bf343e3d85
158                  daf2cf86ca7e188e8360a185f3b43423                  4cc1f798bbcf36862f7aa78c3410801a
159          ) ],          ) ],
160  );  );
161    

Legend:
Removed from v.46  
changed lines
  Added in v.49

  ViewVC Help
Powered by ViewVC 1.1.26