X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F2-input-xml.t;h=ccc44f70475fae4cb64314098242d96138ef666a;hb=a326fb51fd453c22ea509f860dcd272e70c4ffab;hp=ff2f190c35038d474997a7dcb66fef879f077d1e;hpb=b4b7542e2e02125fbe4edd8e0013e85fdbd6bb19;p=webpac2 diff --git a/t/2-input-xml.t b/t/2-input-xml.t index ff2f190..ccc44f7 100755 --- a/t/2-input-xml.t +++ b/t/2-input-xml.t @@ -1,9 +1,9 @@ #!/usr/bin/perl -w use strict; -use blib; +use lib 'lib'; -use Test::More tests => 12; +use Test::More tests => 24; BEGIN { use_ok( 'WebPAC::Test' ); @@ -22,16 +22,17 @@ ok(my $input = new WebPAC::Input( 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/" + path => "$abs_path/data/xml/", + mungle => "$abs_path/conf/mungle/xml.pl", ), "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"); + if ( $mfn >= 7 ) { + ok(! $rec, "error $mfn"); } else { - ok(! $rec, "empty $mfn"); + ok($rec, "fetch $mfn"); } cmp_ok($input->pos, '==', $mfn, "pos $mfn");