X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F2-input-isi.t;h=289e8f806d2708160aebf0db275f20908208b02f;hb=ac3e38c6121e07fdc54f874de8f22ba5ce5ba781;hp=1e450a8b5c07cccdf5ea3f79dc1dc5dc556641d9;hpb=a97909c529f087087e1154b792174ef675825b3e;p=webpac2 diff --git a/t/2-input-isi.t b/t/2-input-isi.t index 1e450a8..289e8f8 100755 --- a/t/2-input-isi.t +++ b/t/2-input-isi.t @@ -1,44 +1,35 @@ #!/usr/bin/perl -w -use Test::More tests => 9; -use Test::Exception; -use Cwd qw/abs_path/; -use blib; use strict; +use lib 'lib'; -use Data::Dump qw/dump/; - -my $debug = @ARGV ? 1 : 0; +use Test::More tests => 12; BEGIN { +use_ok( 'WebPAC::Test' ); use_ok( 'WebPAC::Input' ); } -ok(my $abs_path = abs_path($0), "abs_path"); -$abs_path =~ s#/[^/]*$#/#; # - my $module = 'WebPAC::Input::ISI'; diag "testing with $module"; ok(my $input = new WebPAC::Input( module => $module, - no_log => 0, no_progress_bar => 1, - debug => $debug, + %LOG ), "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, '==', 3, 'size ok' ); foreach my $mfn ( 1 ... $size ) { my $rec = $input->fetch; - if ($mfn <= 10 || $mfn == 20) { - ok($rec, "fetch $mfn"); - } else { - ok(! $rec, "empty $mfn"); - } + + ok( exists($rec->{TI}), 'TI' ); cmp_ok($input->pos, '==', $mfn, "pos $mfn");