/[webpac2]/trunk/t/2-input-excel.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-excel.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1095 - (hide annotations)
Fri Aug 1 23:41:47 2008 UTC (15 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 914 byte(s)
local changes

1 dpavlin 498 #!/usr/bin/perl -w
2    
3 dpavlin 949 use strict;
4 dpavlin 498 use blib;
5    
6 dpavlin 949 use Test::More tests => 45;
7 dpavlin 498
8     BEGIN {
9 dpavlin 949 use_ok( 'WebPAC::Test' );
10 dpavlin 727 use_ok( 'WebPAC::Input' );
11 dpavlin 498 }
12    
13     my $module = 'WebPAC::Input::Excel';
14     diag "testing with $module";
15    
16 dpavlin 1095 our ($input,$db,$size);
17 dpavlin 498
18 dpavlin 1095 sub open_xls {
19 dpavlin 498
20 dpavlin 1095 ok($input = new WebPAC::Input(
21     module => $module,
22     no_progress_bar => 1,
23     %LOG,
24     ), "new $module");
25    
26     my $path = shift;
27     $path = "$abs_path/data/$path";
28     ok(my $db = $input->open( path => $path ), "open $path");
29     ok($size = $input->size, "size $size");
30     return $db;
31     }
32    
33    
34     open_xls('excel_95.xls');
35    
36 dpavlin 498 foreach my $mfn ( 1 ... $size ) {
37     my $rec = $input->fetch;
38     if ($mfn <= 10 || $mfn == 20) {
39     ok($rec, "fetch $mfn");
40     } else {
41     ok(! $rec, "empty $mfn");
42     }
43    
44     cmp_ok($input->pos, '==', $mfn, "pos $mfn");
45    
46 dpavlin 949 diag "rec: ", dump($rec), "\n" if $debug;
47 dpavlin 498 }
48    
49 dpavlin 1095 open_xls('stara-signatura.xls');
50    
51     foreach my $mfn ( 20 .. 23 ) {
52     diag dump( $input->fetch( $mfn ) ) if $debug;
53     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26