1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
3 |
use Test::More tests => 116; |
use Test::More tests => 123; |
4 |
use Test::Exception; |
use Test::Exception; |
5 |
use Cwd qw/abs_path/; |
use Cwd qw/abs_path/; |
6 |
use blib; |
use blib; |
18 |
my $no_log = $debug ? 0 : 1; |
my $no_log = $debug ? 0 : 1; |
19 |
|
|
20 |
ok(my $abs_path = abs_path($0), "abs_path"); |
ok(my $abs_path = abs_path($0), "abs_path"); |
21 |
$abs_path =~ s#/[^/]*$#/#; |
$abs_path =~ s#/[^/]*$#/#; #vim |
22 |
|
|
23 |
my $module = 'WebPAC::Input::ISIS'; |
my $module = 'WebPAC::Input::ISIS'; |
24 |
diag "testing with $module"; |
diag "testing with $module"; |
25 |
|
|
26 |
throws_ok { my $input = new WebPAC::Input( ) } qr/module/, "need module"; |
throws_ok { my $input = new WebPAC::Input( no_log => $no_log ) } qr/module/, "need module"; |
27 |
ok(my $input = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1, stats => 1 ), "new $module"); |
ok(my $input = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1, stats => 1 ), "new $module"); |
28 |
ok(my $input_lm = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1 ), "new $module"); |
ok(my $input_lm = new WebPAC::Input( module => $module, no_log => $no_log, no_progress_bar => 1 ), "new $module"); |
29 |
|
|
79 |
cmp_ok($input->pos, '==', $mfn, "pos $mfn"); |
cmp_ok($input->pos, '==', $mfn, "pos $mfn"); |
80 |
push @db, $rec; |
push @db, $rec; |
81 |
ok(my $dump = $input->dump_ascii, "dump_ascii $mfn"); |
ok(my $dump = $input->dump_ascii, "dump_ascii $mfn"); |
82 |
|
# XXX test count will help us keep this test in-line :-) |
83 |
|
ok($rec->{leader}, "leader $mfn") if $rec->{leader}; |
84 |
diag $dump if ($debug); |
diag $dump if ($debug); |
85 |
} |
} |
86 |
|
|
195 |
modify_records => { |
modify_records => { |
196 |
900 => { |
900 => { |
197 |
'^a' => { '^e' => ' : ^e' }, |
'^a' => { '^e' => ' : ^e' }, |
198 |
} |
}, |
199 |
|
901 => { |
200 |
|
'^a' => { 'foo' => 'baz' }, |
201 |
|
}, |
202 |
}, |
}, |
203 |
), "open (with modify_records for empty subfields)"); |
), "open (with modify_records for empty subfields)"); |
204 |
|
|
211 |
'^afoo^ebar', |
'^afoo^ebar', |
212 |
'^afoo : ^ebar', |
'^afoo : ^ebar', |
213 |
); |
); |
214 |
|
|
215 |
|
test_filter(901, |
216 |
|
'^afoo^ebar', |
217 |
|
'^abaz^ebar', |
218 |
|
); |