X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=t%2F23-resultset.t;h=7a026ffcc1b39acb9c6b348aa1e76a69623e5ad2;hb=87c72eaf97a3dbf51a93dab782c2909539addc48;hp=6a13a2592718c21b0a36c299052446304954a0af;hpb=e35858ff97a290c30acae73387060b0be320a7b1;p=ZOOM-Perl-moved-to-github.git diff --git a/t/23-resultset.t b/t/23-resultset.t index 6a13a25..7a026ff 100644 --- a/t/23-resultset.t +++ b/t/23-resultset.t @@ -1,14 +1,12 @@ -# $Id: 23-resultset.t,v 1.3 2005-11-07 15:48:25 mike Exp $ - # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl 23-resultset.t' use strict; use warnings; -use Test::More tests => 23; +use Test::More tests => 24; BEGIN { use_ok('ZOOM') }; -my $host = "indexdata.com/gils"; +my $host = "z3950.indexdata.com/gils"; my $conn; eval { $conn = new ZOOM::Connection($host, 0) }; ok(!$@, "connection to '$host'"); @@ -19,12 +17,17 @@ eval { $rs = $conn->search_pqf($query) }; ok(!$@, "search for '$query'"); ok($rs->size() == 2, "found 2 records"); -my $syntax = "usmarc"; +my $syntax = "canmarc"; # not supported $rs->option(preferredRecordSyntax => $syntax); my $val = $rs->option("preferredRecordSyntax"); ok($val eq $syntax, "preferred record syntax set to '$val'"); my $rec = $rs->record(0); +my($errcode, $errmsg) = $rec->error(); +ok($errcode == 238, "can't fetch CANMARC ($errmsg)"); + +$rs->option(preferredRecordSyntax => "usmarc"); +$rec = $rs->record(0); my $data1 = $rec->render(); $rs->option(elementSetName => "b"); my $data2 = $rec->render();