single field search mapping to fill text indexes
[Biblio-Z3950.git] / t / 6-CROSBI.t
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use Test::More tests => 11;
7
8 my $search = join(' ', @ARGV) || 'fti_au: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 $hits = 3 unless $ENV{DEBUG};
23
24 foreach ( 1 .. $hits ) {
25
26         ok( my $marc = $o->next_marc, "next_marc $_" );
27         diag $marc;
28
29 }
30
31 } # database
32