Fix merging of terms in the AdvancedQueryParser
ClosedPublic

Authored by bruns on Apr 7 2018, 1:26 AM.

Details

Summary

The code merged compatible terms only if the left hand side was a list of
subterms (i.e. it worked for "a AND b AND (c AND d)", but not
"b AND (c AND d)"). Instead of duplicating code, just use the
Term(Term, Operation, Term) constructor, which handles merging.

Test Plan

ctest -V -R advancedqueryparser

38: QDEBUG : AdvancedQueryParserTest::testNestedParentheses((a AND (b AND (c AND d))))   result term ( AND ( : a (QString)) ( : b (QString)) ( : c (QString)) ( : d (QString)) )
38: QDEBUG : AdvancedQueryParserTest::testNestedParentheses((a AND (b AND (c AND d)))) expected term ( AND ( : a (QString)) ( : b (QString)) ( : c (QString)) ( : d (QString)) )
38: PASS   : AdvancedQueryParserTest::testNestedParentheses((a AND (b AND (c AND d))))

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Apr 7 2018, 1:26 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptApr 7 2018, 1:26 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
bruns requested review of this revision.Apr 7 2018, 1:26 AM
bruns edited the test plan for this revision. (Show Details)

lgtm. Please rebase (preferrably after landing D11826), so I can run the test.

 Cherry Pick Failed!
 Exception 
Command failed with error #1!
COMMAND
git cherry-pick 'arcpatch-D11907'
bruns updated this revision to Diff 31585.Apr 7 2018, 11:32 AM

rebased

bruns updated this revision to Diff 31685.Apr 8 2018, 3:52 PM
michaelh accepted this revision.Apr 13 2018, 8:46 PM
This revision is now accepted and ready to land.Apr 13 2018, 8:46 PM
This revision was automatically updated to reflect the committed changes.