[Koha-bugs] [Bug 11297] Add support for custom PQF attributes for Z39.50 server searches

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon May 2 02:31:40 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11297

--- Comment #38 from David Cook <dcook at prosentient.com.au> ---
(In reply to Marcel de Rooy from comment #37)
> I would agree with you that is not necessary to test string concatenation.

I disagree. I think it is important to test string concatenation, as the query
is just a string, and it's possible that concatenation could mess up the query.

> We should be pragmatic in this regard.
> I guess the point here is not if you can concatenate strings but if you add
> this stuff to the query, will we still have results? Can you predict what
> will happen in a test case?
> This will be hard because we probably do not like to query external sources
> in a unit test.
> I once added some stuff in t/db_dependent/Breeding.t in order to start some
> testing of this module.

Spot on! 

Alternatives to querying an external source would be parsing the query. We
might be able to use the ZOOM modules for that.

Example:
$q = new ZOOM::Query::PQF('@attr 1=4 dinosaur');

"Creates a new query object, compiling the query passed as its argument
according to the rules of the particular query-type being instantiated. If
compilation fails, an exception is thrown. Otherwise, the query may be passed
to the Connection method search()."

http://search.cpan.org/~mirk/Net-Z3950-ZOOM/lib/ZOOM.pod#ZOOM::Query

BOOM! Surely that should work?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list