From: Dan Scott Date: Tue, 27 Nov 2012 18:45:50 +0000 (-0500) Subject: Fix some failing QP unit tests X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fdbs%2Fquery_parser_for_2_3;p=working%2FEvergreen.git Fix some failing QP unit tests Adjust to the shifting query structures; ideally we would update the unit tests expected output at the same time as the query structure changes, but better to catch some changes now than not at all. Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/perlmods/t/21-QueryParser.t b/Open-ILS/src/perlmods/t/21-QueryParser.t index 242799999d..04145d39d1 100644 --- a/Open-ILS/src/perlmods/t/21-QueryParser.t +++ b/Open-ILS/src/perlmods/t/21-QueryParser.t @@ -71,8 +71,8 @@ my %queries = ( my $query = shift; # Unfortunately, the canonical representation of a query in master # as of 2012/09/07 is not unambiguous - is($QParser->parse_tree()->to_abstract_query()->{children}->{'&'}, undef, "Outer-most operator in query {$query} is not AND"); - is(ref $QParser->parse_tree()->to_abstract_query()->{children}->{'|'}, 'ARRAY', "Outer-most operator in query {$query} is OR"); + is(ref $QParser->parse_tree()->to_abstract_query()->{children}->{'&'}, 'ARRAY', "Outer-most operator in query {$query} is not AND"); + is($QParser->parse_tree()->to_abstract_query()->{children}->{'|'}, undef, "Outer-most operator in query {$query} is OR"); }, 'keyword1 keyword2 && keyword3 keyword4' => undef, 'keyword1 author:keyword2' => undef, @@ -87,7 +87,7 @@ my %queries = ( }, '(keyword1 keyword2) || keyword3 #available' => sub { my $query = shift; - is($QParser->parse_tree->to_abstract_query()->{modifiers}->[0], 'available', 'Set modifier for query'); + is($QParser->parse_tree->to_abstract_query()->{children}->{'&'}->[0]->{children}->{'|'}->[1]->{modifiers}->[0], 'available', 'Set modifier for query'); }, 'keyword1 testfilter(whatever)' => undef, 'keyword1 sort:something' => undef,