stop on empty next_marc
[Biblio-Z3950.git] / t / 5-DPLA.t
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use Test::More tests => 29;
7
8 my $search = join(' ', @ARGV) || 'krleža';
9
10 use_ok 'DPLA';
11
12 ok( my $o = DPLA->new(), 'new' );
13
14 ok( my $hits = $o->search( $o->usemap->{prefix_term}->( 'dpla.keyword' => $search ) ), "search: $search" );
15 like $hits, qr/^\d+$/, "hits: $hits";
16
17 foreach ( 1 .. 25 ) { # > 20 to hit next page
18
19         ok( my $marc = $o->next_marc, "next_marc $_" );
20         diag $marc;
21
22 }