6 use Test::More tests => 300;
9 use_ok( 'WebPAC::Test' );
10 use_ok( 'WebPAC::Input' );
13 my $module = 'WebPAC::Input::Gutenberg';
14 diag "testing with $module", $debug ? ' with debug' : '';
16 ok(my $input = new WebPAC::Input(
22 ok(my $db = $input->open(
23 path => "$abs_path/data/gutenberg-small.rdf"
25 ok(my $size = $input->size, "size");
27 diag "size: $size" if ($debug);
29 ok(defined($input->{ll_db}->{_rows}), 'have ll_db->rows');
31 foreach my $mfn ( 1 ... $size ) {
33 ok(defined($input->{ll_db}->{_rows}->{$mfn}), "have ll_db->_rows->$mfn");
35 diag "row: ", dump( $input->{ll_db}->{_rows}->{$mfn} ) if ($debug);
37 my $rec = $input->fetch;
39 ok($rec, "fetch $mfn");
41 cmp_ok($input->pos, '==', $mfn, "pos $mfn");
43 diag "rec: ", dump($rec), "\n" if ($debug);