X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest%2FSearch%2FBath.pm;h=80a96458926f22cff51135b7d43331d2f2f6a1ee;hb=HEAD;hp=47af8943bc68d72b98bce708e17c752986114c2e;hpb=dbf1fadda290f6fa6d6e6539954667aad75639c9;p=irspy-moved-to-github.git diff --git a/lib/ZOOM/IRSpy/Test/Search/Bath.pm b/lib/ZOOM/IRSpy/Test/Search/Bath.pm index 47af894..80a9645 100644 --- a/lib/ZOOM/IRSpy/Test/Search/Bath.pm +++ b/lib/ZOOM/IRSpy/Test/Search/Bath.pm @@ -18,12 +18,19 @@ # http://bugzilla.indexdata.dk/show_bug.cgi?id=3352#c0 # wants use to use s=al t=r,l, where "s" is structure (4) and "al" is # AND-list, which apparently sends NO structure attribute; and "t" is -# truncation (5) and "r,l" is right-and-left truncation (3). +# truncation (5) and "r,l" is right-and-left truncation. # # AND-listing (and selection of word or phrase-structure) is now -# invoked in the Toroid, when the list of attributes is emitted; but -# we can't test for 5=100 here, as the Bath Profile says to do, and -# then use that as justification for emitting 5=3 in the Toroid. +# invoked in the Toroid, when the list of attributes is emitted; we +# test for we can't test for 5=100 here, as the Bath Profile says to +# do, and rather optimistically use that as justification for emitting +# t=l,r in the Toroid (which means that individual queries can request +# either left- or right-truncation using "?". +# +# Finally, we also make a test for "X-isbn", an ISBN number search, +# which is not actually in the Bath Profile. This gives us something +# to back down to when the more general Standard Identifier search +# isn't supported. package ZOOM::IRSpy::Test::Search::Bath; @@ -43,6 +50,20 @@ my @bath_queries = ( [ title => 4, 3, 3, 2, 100, 1 ], # 5.A.0.2 [ subject => 21, 3, 3, 2, 100, 1 ], # 5.A.0.3 [ any => 1016, 3, 3, 2, 100, 1 ], # 5.A.0.4 + [ ident => 1007, 3, 1, 1, 100, 1 ], # 5.A.1.14 + [ date => 31, 3, 1, 4, 100, 1 ], # 5.A.1.15 + [ "X-isbn"=> 7, 3, 1, 1, 100, 1 ], # Not in Bath Profile + + # Use attribute only -- fallbacks for when True Bath queries fail + [ "X-author1" => 1 ], + [ "X-author1003" => 1003 ], + [ "X-author1004" => 1004 ], + [ "X-title" => 4 ], + [ "X-subject" => 21 ], + [ "X-any1016" => 1016 ], + [ "X-any1017" => 1017 ], + [ "X-any1035" => 1035 ], + [ "X-isbn7" => 7 ], ); @@ -63,7 +84,12 @@ sub start_search { my $ref = $bath_queries[$qindex]; my($name, @attrs) = @$ref; - my $query = join(" ", map { "\@attr $_=" . $attrs[$_-1] } (1..6)) . " the"; + my $query = "the"; + foreach my $i (1 .. @$ref) { + $query = "\@attr $i=" . $ref->[$i] . " " . $query + if defined $ref->[$i]; + } + $conn->irspy_search_pqf($query, { qindex => $qindex }, {}, ZOOM::Event::ZEND, \&search_complete, "exception", \&search_complete);