/[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 1095 by dpavlin, Fri Aug 1 23:41:47 2008 UTC revision 1106 by dpavlin, Mon Aug 4 19:41:26 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 => 75;
7    
8  BEGIN {  BEGIN {
9  use_ok( 'WebPAC::Test' );  use_ok( 'WebPAC::Test' );
# Line 13  use_ok( 'WebPAC::Input' ); Line 13  use_ok( 'WebPAC::Input' );
13  my $module = 'WebPAC::Input::Excel';  my $module = 'WebPAC::Input::Excel';
14  diag "testing with $module";  diag "testing with $module";
15    
16  our ($input,$db,$size);  ok(my $input = new WebPAC::Input(
17            module => $module,
18            no_progress_bar => 1,
19            %LOG,
20    ), "new");
21    
22  sub open_xls {  our ($db,$size);
   
         ok($input = new WebPAC::Input(  
                 module => $module,  
                 no_progress_bar => 1,  
                 %LOG,  
         ), "new $module");  
23    
24          my $path = shift;  sub open_xls {
25            my $path = shift || die "no path?";
26          $path = "$abs_path/data/$path";          $path = "$abs_path/data/$path";
27          ok(my $db = $input->open( path => $path ), "open $path");          ok(my $db = $input->open( path => $path ), "open $path");
28          ok($size = $input->size, "size $size");          ok($size = $input->size, "size $size");
29          return $db;          return $db;
30  }  }
31    
   
32  open_xls('excel_95.xls');  open_xls('excel_95.xls');
33    
34  foreach my $mfn ( 1 ... $size ) {  foreach my $mfn ( 1 ... $size ) {
# Line 47  foreach my $mfn ( 1 ... $size ) { Line 45  foreach my $mfn ( 1 ... $size ) {
45  }  }
46    
47  open_xls('stara-signatura.xls');  open_xls('stara-signatura.xls');
48    for ( 1 .. 14 ) {
49  foreach my $mfn ( 20 .. 23 ) {          ok( $input->seek( $_ ), "seek $_");
50          diag dump( $input->fetch( $mfn ) ) if $debug;          ok( my $rec = $input->fetch, "fetch $_" );
51            diag dump( $rec ) if $debug;
52  }  }
53    

Legend:
Removed from v.1095  
changed lines
  Added in v.1106

  ViewVC Help
Powered by ViewVC 1.1.26