--- trunk/t/6-unit.t 2005/07/17 22:48:25 22 +++ trunk/t/6-unit.t 2005/12/15 17:01:04 252 @@ -2,16 +2,17 @@ use strict; -use Test::More tests => 23; +use Test::More tests => 34; use Test::Exception; use Cwd qw/abs_path/; use File::Temp qw/tempdir/; +use Data::Dumper; use blib; BEGIN { use_ok( 'WebPAC::Lookup' ); use_ok( 'WebPAC::Input::ISIS' ); -use_ok( 'WebPAC::DB' ); +use_ok( 'WebPAC::Store' ); use_ok( 'WebPAC::Normalize::XML' ); use_ok( 'WebPAC::Output::TT' ); } @@ -21,6 +22,7 @@ diag "abs_path: $abs_path"; my $isis_file = "$abs_path../t/winisis/BIBL"; +$isis_file = '/data/hidra/THS/THS'; diag "isis_file: $isis_file"; @@ -30,24 +32,27 @@ ok(my $isis = new WebPAC::Input::ISIS( code_page => 'ISO-8859-2', # application encoding + limit_mfn => 10, ), "new Input::ISIS"); ok(my $maxmfn = $isis->open( filename => $isis_file, code_page => '852', # database encoding + lookup => $lookup, ), "Input::ISIS->open"); ok(my $path = tempdir( CLEANUP => 1 ), "path"); -ok(my $db = new WebPAC::DB( +ok(my $db = new WebPAC::Store( path => $path, -), "new DB"); + database => '.', +), "new Store"); ok(my $n = new WebPAC::Normalize::XML( # filter => { 'foo' => sub { shift } }, db => $db, lookup_regex => $lookup->regex, - debug => 1, + lookup => $lookup, ), "new Normalize::XML"); ok($n->open( @@ -62,14 +67,17 @@ while (my $row = $isis->fetch) { - ok(my @ds = $n->data_structure($row), "data_structure"); + ok(my $ds = $n->data_structure($row), "data_structure"); -use Data::Dumper; -print Dumper(\@ds); +# diag Dumper($ds); - ok($out->apply( + ok(my $html = $out->apply( template => 'html.tt', - data => @ds, + data => $ds, ), "apply"); + $html =~ s#\s*[\n\r]+\s*##gs; + + diag $html; + };