Bug 12647: PQF QueryParser driver and unit tests fixes
authorTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 8 Aug 2014 17:48:59 +0000 (14:48 -0300)
committerMason James <mtj@kohaaloha.com>
Sat, 25 Jul 2015 13:20:19 +0000 (01:20 +1200)
commit06909e8ead42e74eda6b5af36731ece7226737c6
tree7edb550553f54c3ea04e4512d6940847965e001a
parentaff48ab48928027b6ea1528ebd3d81392e480764
Bug 12647: PQF QueryParser driver and unit tests fixes

Due to Perl 5.18, QueryParser the default search class is no longer
'keyword' (see bug 12738), and needs to be set manually. This patch
adds a line that does that. The problem that gets fixed is with test
'super simple keyword query'.

The rest of the non-deterministically failing tests are due to the same
problem, keys returning differently sorted keys from hashes.

So this patch sorts keys in the step that concatenates attributes when building
the PQF queries (and tests get adjusted to match the now deterministic result).

I did that (sorting there) under Jared's recommendation. Hopefuly he will step
in and comment/fix any mistake I made. My main concern was a possible loss
in performance. That we agreed it is almost void, because of the tiny size
of the hash.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests are passing now again :)
Signed-off-by: Mason James <mtj@kohaaloha.com>
Koha/QueryParser/Driver/PQF/Util.pm
t/QueryParser.t