Digital Public Library of America
[Biblio-Z3950.git] / t / 5-DPLA.t
diff --git a/t/5-DPLA.t b/t/5-DPLA.t
new file mode 100755 (executable)
index 0000000..da10def
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::More tests => 29;
+
+my $search = join(' ', @ARGV) || 'krleža';
+
+use_ok 'DPLA';
+
+ok( my $o = DPLA->new(), 'new' );
+
+ok( my $hits = $o->search( $o->usemap->{prefix_term}->( 'dpla.keyword' => $search ) ), "search: $search" );
+like $hits, qr/^\d+$/, "hits: $hits";
+
+foreach ( 1 .. 25 ) { # > 20 to hit next page
+
+       ok( my $marc = $o->next_marc, "next_marc $_" );
+       diag $marc;
+
+}