X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest%2FRecord%2FOPAC.pm;h=caca4cee843bd76bc747ef96e98df9e8e2fc7da8;hp=2009750aa6bfe9e5cad2f11dbda1ac7c2e929a06;hb=HEAD;hpb=052d03dd026af82f5ff87149f9917dee51c2d072 diff --git a/lib/ZOOM/IRSpy/Test/Record/OPAC.pm b/lib/ZOOM/IRSpy/Test/Record/OPAC.pm index 2009750..caca4ce 100644 --- a/lib/ZOOM/IRSpy/Test/Record/OPAC.pm +++ b/lib/ZOOM/IRSpy/Test/Record/OPAC.pm @@ -12,7 +12,7 @@ use ZOOM::IRSpy::Test; our @ISA = qw(ZOOM::IRSpy::Test); my @queries = ( - "\@attr 1=4 mineralazsdfdsf", + "\@attr 1=4 mineral", "\@attr 1=4 computer", "\@attr 1=44 mineral", # Smithsonian doesn't support AP 4! "\@attr 1=1016 water", # Connector Framework only does 1016 @@ -33,6 +33,7 @@ sub start { my $class = shift(); my($conn) = @_; + #$conn->option(apdulog => 1); $conn->option(preferredRecordSyntax => "opac"); $conn->irspy_search_pqf($queries[0], { queryindex => 0 }, \%options, ZOOM::Event::ZEND, \&completed_search, @@ -74,8 +75,16 @@ sub completed_search { # We have a result-set of three of more records, and we requested # that those records be included in the Search Response using # piggybacking. Was it done? + my $ok = 0; my $rec = $task->{rs}->record_immediate(2); - my $ok = defined $rec; + if (defined $rec) { + my $syntax = $rec->get("syntax"); + if (lc($syntax) ne "opac") { + $conn->log("irspy_test", "requested OPAC record, but got $syntax"); + } else { + $ok = $rec->error() == 0; + } + } $task->{rs}->destroy(); $conn->record()->store_result('multiple_opac', 'ok' => $ok);