5 use Test::More tests => 23;
8 use File::Temp qw/tempdir/;
12 use_ok( 'WebPAC::Lookup' );
13 use_ok( 'WebPAC::Input::ISIS' );
14 use_ok( 'WebPAC::DB' );
15 use_ok( 'WebPAC::Normalize::XML' );
16 use_ok( 'WebPAC::Output::TT' );
19 ok(my $abs_path = abs_path($0), "abs_path");
20 $abs_path =~ s#/[^/]*$#/#;
21 diag "abs_path: $abs_path";
23 my $isis_file = "$abs_path../t/winisis/BIBL";
24 $isis_file = '/data/hidra/THS/THS';
26 diag "isis_file: $isis_file";
28 ok(my $lookup = new WebPAC::Lookup(
29 lookup_file => "$abs_path../conf/lookup/isis.pm",
32 ok(my $isis = new WebPAC::Input::ISIS(
33 code_page => 'ISO-8859-2', # application encoding
35 ), "new Input::ISIS");
37 ok(my $maxmfn = $isis->open(
38 filename => $isis_file,
39 code_page => '852', # database encoding
40 ), "Input::ISIS->open");
42 ok(my $path = tempdir( CLEANUP => 1 ), "path");
44 ok(my $db = new WebPAC::DB(
48 ok(my $n = new WebPAC::Normalize::XML(
49 # filter => { 'foo' => sub { shift } },
51 lookup_regex => $lookup->regex,
53 ), "new Normalize::XML");
57 xml_file => "$abs_path../conf/normalize/isis.xml",
58 ), "Normalize::XML->open");
60 ok(my $out = new WebPAC::Output::TT(
61 include_path => "$abs_path../conf/output/tt",
62 filters => { foo => sub { shift } },
65 while (my $row = $isis->fetch) {
67 ok(my @ds = $n->data_structure($row), "data_structure");
73 template => 'html.tt',