From: Mike Taylor Date: Wed, 19 Dec 2012 10:04:25 +0000 (+0000) Subject: Resolve X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=08f7276dbdd4b6d3f02cfa3f4b4d06f0af331055;hp=fc4e7fcfcd28822a2a73e61e2724b0d87bf2b1d6 Resolve --- diff --git a/Changes b/Changes index 27a870e..dc1415c 100644 --- a/Changes +++ b/Changes @@ -22,6 +22,8 @@ Revision history for Perl extension ZOOM::IRSpy. dozen elements. - New script bin/irspy-xpath.pl -- a simple wrapper for running an XPath with IRSpy-related namespaces established. + - Record::Fetch test registers a fail when the syntax actually + retrieved does not match that requested. Fixes bug IR-324. - Add new test, Record::PiggyBack, with support for viewing, editing and storing results. Fixes bug IR-333. - IDs used in URLs for full-record links are properly diff --git a/README b/README index 8020b8d..93d10aa 100644 --- a/README +++ b/README @@ -18,7 +18,7 @@ package store, using apt-get: sudo apt-get install \ libnet-z3950-zoom-perl \ - libxml-libxml-common-perl \ + libxml-libxml-perl \ liburi-perl \ libxml-libxml-perl \ libapache2-mod-perl2 \ diff --git a/lib/ZOOM/IRSpy/Test/Record/Fetch.pm b/lib/ZOOM/IRSpy/Test/Record/Fetch.pm index 5e62a96..f12d137 100644 --- a/lib/ZOOM/IRSpy/Test/Record/Fetch.pm +++ b/lib/ZOOM/IRSpy/Test/Record/Fetch.pm @@ -121,13 +121,18 @@ sub record { defined $record ? $record->exception() : $conn->exception()); } else { - $ok = 1; - my $text = $record->render(); - $conn->log("irspy_test", "Successfully retrieved a $syn record"); - if (0) { - print STDERR "Hits: ", $rs->size(), "\n"; - print STDERR "Syntax: ", $syn, "\n"; - print STDERR $text; + my $actual = $record->get("syntax"); + if (lc($actual) ne lc($syn)) { + $conn->log("irspy_test", "requested $syn record, but got $actual"); + } else { + $ok = 1; + my $text = $record->render(); + $conn->log("irspy_test", "Successfully retrieved a $syn record ($actual)"); + if (0) { + print STDERR "Hits: ", $rs->size(), "\n"; + print STDERR "Syntax: ", $syn, "\n"; + print STDERR $text; + } } } diff --git a/lib/ZOOM/IRSpy/Test/Record/OPAC.pm b/lib/ZOOM/IRSpy/Test/Record/OPAC.pm index 4045201..caca4ce 100644 --- a/lib/ZOOM/IRSpy/Test/Record/OPAC.pm +++ b/lib/ZOOM/IRSpy/Test/Record/OPAC.pm @@ -75,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 && $rec->error() == 0; + 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);