projects
/
webpac2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1802@llin: dpavlin | 2009-04-23 15:20:49 +0200
[webpac2]
/
t
/
2-input-isi.t
diff --git
a/t/2-input-isi.t
b/t/2-input-isi.t
index
d205a2c
..
6e0e1c4
100755
(executable)
--- a/
t/2-input-isi.t
+++ b/
t/2-input-isi.t
@@
-1,47
+1,41
@@
#!/usr/bin/perl -w
#!/usr/bin/perl -w
-use Test::More tests => 45;
-use Test::Exception;
-use Cwd qw/abs_path/;
-use blib;
use strict;
use strict;
+use blib;
-use Data::Dump qw/dump/;
-
-my $debug = 1;
+use Test::More tests => 12;
BEGIN {
BEGIN {
+use_ok( 'WebPAC::Test' );
use_ok( 'WebPAC::Input' );
}
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,
my $module = 'WebPAC::Input::ISI';
diag "testing with $module";
ok(my $input = new WebPAC::Input(
module => $module,
- no_log => 0,
no_progress_bar => 1,
no_progress_bar => 1,
- debug => $debug,
+ %LOG
), "new");
ok(my $db = $input->open(
path => "$abs_path/data/recs.txt"
), "open");
ok(my $size = $input->size, "size");
), "new");
ok(my $db = $input->open(
path => "$abs_path/data/recs.txt"
), "open");
ok(my $size = $input->size, "size");
+cmp_ok( $size, '==', 2, 'size ok' );
foreach my $mfn ( 1 ... $size ) {
my $rec = $input->fetch;
if ($mfn <= 10 || $mfn == 20) {
ok($rec, "fetch $mfn");
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");
}
cmp_ok($input->pos, '==', $mfn, "pos $mfn");
} else {
ok(! $rec, "empty $mfn");
}
cmp_ok($input->pos, '==', $mfn, "pos $mfn");
- diag "rec: ", dump($rec), "\n";
+ diag "rec: ", dump($rec), "\n"
if $debug
;
}
}