force utf-8 encoding on all data comming from file
[webpac2] / t / 2-input-pdf.t
index c0098ba..84b5697 100755 (executable)
@@ -3,11 +3,20 @@
 use strict;
 use blib;
 
-use Test::More tests => 9;
+use Test::More;
 
 BEGIN {
-use_ok( 'WebPAC::Test' );
-use_ok( 'WebPAC::Input' );
+
+       eval "use CAM::PDF";
+
+       if ( $@ ) {
+               plan skip_all => "CAM::PDF required for WebPAC::Input::PDF";
+       } else {
+               plan tests => 11;
+       }
+
+       use_ok( 'WebPAC::Test' );
+       use_ok( 'WebPAC::Input' );
 }
 
 my $module = 'WebPAC::Input::PDF';
@@ -24,6 +33,8 @@ ok(my $db = $input->open(
 ), "open");
 ok(my $size = $input->size, "size");
 
+$size = 3;
+
 foreach my $mfn ( 1 ... $size ) {
        my $rec = $input->fetch;
        if ($mfn <= 10 || $mfn == 20) {