--- trunk/t/2-input.t 2006/05/14 22:38:01 505 +++ trunk/t/2-input.t 2006/05/15 09:59:05 506 @@ -1,16 +1,21 @@ #!/usr/bin/perl -w -use Test::More tests => 61; +use Test::More tests => 62; use Test::Exception; use Cwd qw/abs_path/; use blib; use strict; +use Data::Dumper; + BEGIN { use_ok( 'WebPAC::Input::ISIS' ); use_ok( 'WebPAC::Input::MARC' ); } +my $debug = 1; +my $no_log = $debug ? 0 : 1; + ok(my $abs_path = abs_path($0), "abs_path"); $abs_path =~ s#/[^/]*$#/#; @@ -18,8 +23,8 @@ diag "testing with $module"; throws_ok { my $input = new WebPAC::Input( ) } qr/module/, "need module"; -ok(my $input = new WebPAC::Input( module => $module, no_log => 0, no_progress_bar => 1 ), "new"); -ok(my $input_lm = new WebPAC::Input( module => $module, low_mem => 1, no_log => 1, no_progress_bar => 1 ), "new $module"); +ok(my $input = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1, stats => 1 ), "new"); +ok(my $input_lm = new WebPAC::Input( module => $module, low_mem => 1, no_log => $no_log, no_progress_bar => 1 ), "new $module"); throws_ok { $input->open( ) } qr/path/, "need path"; @@ -73,10 +78,13 @@ test_start_limit($input, 3, $size, $size - 2); test_start_limit($input, 1, $size + 2, $size); +ok(my $s = $input->stats, 'stats'); +diag "stats: ",Dumper($s); + $module = 'WebPAC::Input::MARC'; diag "testing with $module"; -ok($input = new WebPAC::Input( module => $module, low_mem => 1, no_log => 1, no_progress_bar => 1 ), "new $module"); +ok($input = new WebPAC::Input( module => $module, low_mem => 1, no_log => $no_log, no_progress_bar => 1 ), "new $module"); ok($input->open( path => "$abs_path/data/marc.iso" ), "open");