my $log = $self->_get_logger();
- our $xml = XMLin(
- $path,
-# ForceArray => 1,
-# ForceContent => 1,
- KeepRoot => 1,
-# SuppressEmpty => 1, # '' undef
-
- ) || $log->logdie("can't open $path: $!");
+ our $xml;
+ eval {
+ $xml = XMLin(
+ $path,
+# ForceArray => 1,
+# ForceContent => 1,
+ KeepRoot => 1,
+# SuppressEmpty => 1, # '' undef
+ ) || die "can't open $path: $!";
+ };
+
+ if ( $@ ) {
+ $log->error("$@");
+ return;
+ }
$log->debug("fetch_rec( $mfn ) => $path => xml is ",sub { dump($xml) });
use strict;
use blib;
-use Test::More tests => 18;
+use Test::More tests => 24;
BEGIN {
use_ok( 'WebPAC::Test' );
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");