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)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 11 Aug 2014 13:09:38 +0000 (10:09 -0300)
commit27eccf412217c18f282ae9e97e94885209a9ba69
tree3559f5eb7c232f6395712968b85bf4c244db76e5
parent80a1225bb732fb957af483cfa64face8631165bf
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: Tomas Cohen Arazi <tomascohen@gmail.com>
Koha/QueryParser/Driver/PQF/Util.pm
t/QueryParser.t