12 plan skip_all => "XBase required for WebPAC::Input::DBF";
17 use_ok( 'WebPAC::Test' );
18 use_ok( 'WebPAC::Input' );
21 my $module = 'WebPAC::Input::DBF';
22 diag "testing with $module", $debug ? ' with debug' : '';
24 ok(my $input = new WebPAC::Input(
30 ok(my $db = $input->open(
31 path => "$abs_path/data/cas2000.dbf",
33 mapping_path => "$abs_path/conf/input/dbf/cas2000.yml",
36 ok(my $size = $input->size, "size");
38 diag "size: $size" if ($debug);
40 ok(defined($input->{ll_db}->{_rows}), 'have ll_db->rows');
42 foreach my $mfn ( 1 ... $size ) {
44 ok(defined($input->{ll_db}->{_rows}->{$mfn}), "have ll_db->_rows->$mfn");
46 diag "row: ", dump( $input->{ll_db}->{_rows}->{$mfn} ) if ($debug);
48 my $rec = $input->fetch;
50 ok($rec, "fetch $mfn");
52 cmp_ok($input->pos, '==', $mfn, "pos $mfn");
54 diag "rec: ", dump($rec), "\n" if ($debug);