/[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

Contents of /trunk/t/2-input-excel.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1095 - (show 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 #!/usr/bin/perl -w
2
3 use strict;
4 use blib;
5
6 use Test::More tests => 45;
7
8 BEGIN {
9 use_ok( 'WebPAC::Test' );
10 use_ok( 'WebPAC::Input' );
11 }
12
13 my $module = 'WebPAC::Input::Excel';
14 diag "testing with $module";
15
16 our ($input,$db,$size);
17
18 sub open_xls {
19
20 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 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 diag "rec: ", dump($rec), "\n" if $debug;
47 }
48
49 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