use utf-8 encoding
[webpac2] / t / 2-input-isi.t
index 6e0e1c4..c987749 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use blib;
+use lib 'lib';
 
 use Test::More tests => 12;
 
@@ -20,19 +20,16 @@ ok(my $input = new WebPAC::Input(
 ), "new");
 
 ok(my $db = $input->open(
-       path => "$abs_path/data/recs.txt"
+#      path => "$abs_path/data/recs.txt"
+       path => "$abs_path/data/isi.txt"
 ), "open");
 ok(my $size = $input->size, "size");
-cmp_ok( $size, '==', 2, 'size ok' );
+cmp_ok( $size, '==', 3, 'size ok' );
 
 foreach my $mfn ( 1 ... $size ) {
        my $rec = $input->fetch;
-       if ($mfn <= 10 || $mfn == 20) {
-               ok($rec, "fetch $mfn");
-               cmp_ok($rec->{'000'}->[0], '==', $mfn, 'has mfn');
-       } else {
-               ok(! $rec, "empty $mfn");
-       }
+
+       ok( $rec->{TI}, 'TI' );
 
        cmp_ok($input->pos, '==', $mfn, "pos $mfn");