/[webpac2]/trunk/t/6-unit.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/6-unit.t

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

revision 767 by dpavlin, Tue Oct 31 13:44:42 2006 UTC revision 1100 by dpavlin, Sat Aug 2 23:46:41 2008 UTC
# Line 7  use Test::Exception; Line 7  use Test::Exception;
7  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
8  use File::Temp qw/tempdir/;  use File::Temp qw/tempdir/;
9  use File::Slurp;  use File::Slurp;
10  use Data::Dumper;  use Data::Dump qw/dump/;
11  use Time::HiRes qw/time/;  use Time::HiRes qw/time/;
12  use blib;  use blib;
13    
# Line 39  my $lookup_file = "$abs_path../conf/look Line 39  my $lookup_file = "$abs_path../conf/look
39    
40  ok(my $isis = new WebPAC::Input(  ok(my $isis = new WebPAC::Input(
41          module => 'WebPAC::Input::ISIS',          module => 'WebPAC::Input::ISIS',
         code_page => 'ISO-8859-2',      # application encoding  
42          limit => 100,          limit => 100,
43          no_progress_bar => 1,          no_progress_bar => 1,
44  ), "new Input::ISIS");  ), "new Input::ISIS");
45    
46  ok(my $maxmfn = $isis->open(  ok(my $maxmfn = $isis->open(
47          path => $isis_file,          path => $isis_file,
48          code_page => 'cp852',           # database encoding          input_encoding => 'cp852',              # database encoding
49          lookup_coderef => sub {          lookup_coderef => sub {
50                  my $rec = shift || return;                  my $rec = shift || return;
51                  ok($rec, 'lookup_coderef has rec');                  ok($rec, 'lookup_coderef has rec');
# Line 56  ok(my $maxmfn = $isis->open( Line 55  ok(my $maxmfn = $isis->open(
55    
56  ok(my $path = tempdir( CLEANUP => 1 ), "path");  ok(my $path = tempdir( CLEANUP => 1 ), "path");
57    
58  ok(my $db = new WebPAC::Store(  ok(my $db = new WebPAC::Store({
         path => $path,  
59          database => '.',          database => '.',
60  ), "new Store");  }), "new Store");
61    
62  ok(my $norm_pl = read_file( $normalize_set_pl ), "set definitions: $normalize_set_pl" );  ok(my $norm_pl = read_file( $normalize_set_pl ), "set definitions: $normalize_set_pl" );
63    
# Line 74  foreach my $pos ( 0 ... $isis->size ) { Line 72  foreach my $pos ( 0 ... $isis->size ) {
72    
73          my $row = $isis->fetch || next;          my $row = $isis->fetch || next;
74    
75          diag " row $pos => ",Dumper($row) if ($debug);          diag " row $pos => ",dump($row) if ($debug);
76    
77          my $t = time();          my $t = time();
78          ok( my $ds = WebPAC::Normalize::data_structure(          ok( my $ds = WebPAC::Normalize::data_structure(
# Line 83  foreach my $pos ( 0 ... $isis->size ) { Line 81  foreach my $pos ( 0 ... $isis->size ) {
81          ), "Set data_structure");          ), "Set data_structure");
82          $t_norm += time() - $t;          $t_norm += time() - $t;
83    
84          diag " ds $pos => ",Dumper($ds) if ($debug);          diag " ds $pos => ",dump($ds) if ($debug);
85    
86          ok(my $html = $out->apply(          ok(my $html = $out->apply(
87                  template => 'html.tt',                  template => 'html.tt',

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

  ViewVC Help
Powered by ViewVC 1.1.26