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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 949 by dpavlin, Thu Nov 1 00:16:48 2007 UTC revision 1100 by dpavlin, Sat Aug 2 23:46:41 2008 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 45;  use Test::More tests => 49;
7    
8  BEGIN {  BEGIN {
9  use_ok( 'WebPAC::Test' );  use_ok( 'WebPAC::Test' );
# Line 19  ok(my $input = new WebPAC::Input( Line 19  ok(my $input = new WebPAC::Input(
19          %LOG,          %LOG,
20  ), "new");  ), "new");
21    
22  ok(my $db = $input->open(  our ($db,$size);
23          path => "$abs_path/data/excel_95.xls"  
24  ), "open");  sub open_xls {
25  ok(my $size = $input->size, "size");          my $args = shift;
26    
27            $args->{path} = "$abs_path/data/" . $args->{path} || die "no path?";
28            ok(my $db = $input->open( %$args ), "open " . dump( $args ));
29            ok($size = $input->size, "size $size");
30            return $db;
31    }
32    
33    open_xls({ path => 'excel_95.xls' });
34    
35  foreach my $mfn ( 1 ... $size ) {  foreach my $mfn ( 1 ... $size ) {
36          my $rec = $input->fetch;          my $rec = $input->fetch;
# Line 37  foreach my $mfn ( 1 ... $size ) { Line 45  foreach my $mfn ( 1 ... $size ) {
45          diag "rec: ", dump($rec), "\n" if $debug;          diag "rec: ", dump($rec), "\n" if $debug;
46  }  }
47    
48    open_xls({ path => 'stara-signatura.xls', input_encoding => 'utf-16' });
49    ok( $input->seek( 790 ), 'seek 790');
50    ok( my $rec = $input->fetch, 'fetch' );
51    diag dump( $rec );

Legend:
Removed from v.949  
changed lines
  Added in v.1100

  ViewVC Help
Powered by ViewVC 1.1.26