/[webpac2]/trunk/t/2-input-isi.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/2-input-isi.t

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

revision 949 by dpavlin, Thu Nov 1 00:16:48 2007 UTC revision 1256 by dpavlin, Tue Jul 28 12:40:46 2009 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
4  use blib;  use lib 'lib';
5    
6  use Test::More tests => 9;  use Test::More tests => 12;
7    
8  BEGIN {  BEGIN {
9  use_ok( 'WebPAC::Test' );  use_ok( 'WebPAC::Test' );
# Line 20  ok(my $input = new WebPAC::Input( Line 20  ok(my $input = new WebPAC::Input(
20  ), "new");  ), "new");
21    
22  ok(my $db = $input->open(  ok(my $db = $input->open(
23          path => "$abs_path/data/recs.txt"  #       path => "$abs_path/data/recs.txt"
24            path => "$abs_path/data/isi.txt"
25  ), "open");  ), "open");
26  ok(my $size = $input->size, "size");  ok(my $size = $input->size, "size");
27    cmp_ok( $size, '==', 3, 'size ok' );
28    
29  foreach my $mfn ( 1 ... $size ) {  foreach my $mfn ( 1 ... $size ) {
30          my $rec = $input->fetch;          my $rec = $input->fetch;
31          if ($mfn <= 10 || $mfn == 20) {  
32                  ok($rec, "fetch $mfn");          ok( $rec->{TI}, 'TI' );
         } else {  
                 ok(! $rec, "empty $mfn");  
         }  
33    
34          cmp_ok($input->pos, '==', $mfn, "pos $mfn");          cmp_ok($input->pos, '==', $mfn, "pos $mfn");
35    

Legend:
Removed from v.949  
changed lines
  Added in v.1256

  ViewVC Help
Powered by ViewVC 1.1.26