6 use Test::More tests => 1179;
9 use_ok( 'WebPAC::Test' );
10 use_ok( 'WebPAC::Input' );
13 my $module = 'WebPAC::Input::DBF';
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/cas2000.dbf",
25 mapping_path => "$abs_path/conf/input/dbf/cas2000.yml",
28 ok(my $size = $input->size, "size");
30 diag "size: $size" if ($debug);
32 ok(defined($input->{ll_db}->{_rows}), 'have ll_db->rows');
34 foreach my $mfn ( 1 ... $size ) {
36 ok(defined($input->{ll_db}->{_rows}->{$mfn}), "have ll_db->_rows->$mfn");
38 diag "row: ", dump( $input->{ll_db}->{_rows}->{$mfn} ) if ($debug);
40 my $rec = $input->fetch;
42 ok($rec, "fetch $mfn");
44 cmp_ok($input->pos, '==', $mfn, "pos $mfn");
46 diag "rec: ", dump($rec), "\n" if ($debug);