/[webpac2]/trunk/t/2-input-pdf.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/2-input-pdf.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1256 - (hide annotations)
Tue Jul 28 12:40:46 2009 UTC (14 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 811 byte(s)
use code from lib insted of blib

1 dpavlin 1054 #!/usr/bin/perl -w
2    
3     use strict;
4 dpavlin 1256 use lib 'lib';
5 dpavlin 1054
6 dpavlin 1117 use Test::More;
7 dpavlin 1054
8     BEGIN {
9 dpavlin 1117
10     eval "use CAM::PDF";
11    
12     if ( $@ ) {
13     plan skip_all => "CAM::PDF required for WebPAC::Input::PDF";
14     } else {
15     plan tests => 11;
16     }
17    
18     use_ok( 'WebPAC::Test' );
19     use_ok( 'WebPAC::Input' );
20 dpavlin 1054 }
21    
22     my $module = 'WebPAC::Input::PDF';
23     diag "testing with $module";
24    
25     ok(my $input = new WebPAC::Input(
26     module => $module,
27     no_progress_bar => 1,
28     %LOG
29     ), "new");
30    
31     ok(my $db = $input->open(
32     path => "$abs_path/data/UFOReport1998.pdf"
33     ), "open");
34     ok(my $size = $input->size, "size");
35    
36 dpavlin 1057 $size = 3;
37    
38 dpavlin 1054 foreach my $mfn ( 1 ... $size ) {
39     my $rec = $input->fetch;
40     if ($mfn <= 10 || $mfn == 20) {
41     ok($rec, "fetch $mfn");
42     } else {
43     ok(! $rec, "empty $mfn");
44     }
45    
46     cmp_ok($input->pos, '==', $mfn, "pos $mfn");
47    
48     diag "rec: ", dump($rec), "\n" if $debug;
49     }
50    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26