1 # $Id: 2-ZOOM.t,v 1.2 2005-10-12 11:56:27 mike Exp $
3 # Before `make install' is performed this script should be runnable with
4 # `make test'. After `make install' it should work as `perl ZOOM.t'
6 #########################
8 # change 'tests => 1' to 'tests => last_test_to_print';
11 use Test::More tests => 1;
12 BEGIN { use_ok('ZOOM') };
14 #########################
16 # Insert your test code below, the Test::More module is use()ed here so read
17 # its man page ( perldoc Test::More ) for help writing this test script.
19 my $host = "indexdata.com/gils";
20 $host = "localhost:3950";
23 my $conn = new ZOOM::Connection($host, $port);
25 my $syntax = "usmarc";
26 $conn->option(preferredRecordSyntax => $syntax);
27 my $val = $conn->option("preferredRecordSyntax");
28 die "set preferredRecordSyntax to '$syntax' but got '$val'"
31 my $query = '@attr 1=4 minerals';
32 my $rs = $conn->search_pqf($query);
34 my $n = $rs->size($rs);
36 for (my $i = 0; $i < $n; $i++) {
37 my $rec = $rs->record($i);
38 my $data = $rec->render();
39 my $raw = $rec->raw();