better utf8 test records
[webpac2] / t / 2-input-xml.t
index ff2f190..efba79e 100755 (executable)
@@ -3,7 +3,7 @@
 use strict;
 use blib;
 
-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");