two different crosbi databases searching different tables
[Biblio-Z3950.git] / t / 6-CROSBI.t
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use Test::More tests => 7;
7
8 my $search = join(' ', @ARGV) || 'denis bratko';
9
10 use_ok 'CROSBI';
11
12 ok( my $o = CROSBI->new(), 'new' );
13
14 foreach my $database ( qw( CROSBI-CASOPIS CROSBI-PREPRINT ) ) {
15         diag $o->{database} = $database;
16
17 ok( my $hits = $o->search( $search ), "search: $search" );
18 like $hits, qr/^\d+$/, "hits: $hits";
19
20 diag "SQL", $o->{sql};
21
22 foreach ( 1 .. $hits ) {
23
24         ok( my $marc = $o->next_marc, "next_marc $_" );
25         diag $marc;
26
27 }
28
29 } # database