--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+use blib;
+
+use Test::More tests => 12;
+
+BEGIN {
+use_ok( 'WebPAC::Test' );
+use_ok( 'WebPAC::Input' );
+}
+
+my $module = 'WebPAC::Input::XML';
+diag "testing with $module";
+
+ok(my $input = new WebPAC::Input(
+ module => $module,
+ no_progress_bar => 1,
+ %LOG
+), "new");
+
+throws_ok { $input->open( path => '/tmp/does_not_exit', %LOG ) } qr/can't find path/, 'open with non-existant path';
+
+ok(my $db = $input->open(
+ path => "$abs_path/data/xml/"
+), "open");
+ok(my $size = $input->size, "size");
+
+foreach my $mfn ( 1 ... $size ) {
+ my $rec = $input->fetch;
+ if ($mfn <= 10 || $mfn == 20) {
+ ok($rec, "fetch $mfn");
+ } else {
+ ok(! $rec, "empty $mfn");
+ }
+
+ cmp_ok($input->pos, '==', $mfn, "pos $mfn");
+
+ diag "rec: ", dump($rec), "\n" if $debug;
+}
+