bruns added a comment.
Although this is probably a useful addition (haven't checked which cases the existing unit test already cover), it does not cover the changes in D11826 <https://phabricator.kde.org/D11826>. The code in https://cgit.kde.org/baloo.git/tree/src/lib/advancedqueryparser.cpp#n100 replicates the new logic in the `Term::Term(Term&, Operation&, Term&)` constructor (merging of compatible terms), and, after the changes in D11826 <https://phabricator.kde.org/D11826>, could be replaced with just static void addTermToStack(QStack<Term>& stack, const Term& termInConstruction, Term::Operation op) { auto top = stack.pop(); stack.push(Term(top, op, termInConstruction)); } `operator&&` is e.g. used in https://cgit.kde.org/baloo.git/tree/src/lib/query.cpp#n189 To test operator&&, the following should be true: Term{Term:And, {Term{"", "a"}, Term{"", "b"}, Term{"", "c"}, Term{"", "d"} } == Term{"", "a"} && Term{"", "b"} && Term{"", "c"} && Term{"", "d"} REPOSITORY R293 Baloo REVISION DETAIL https://phabricator.kde.org/D11907 To: michaelh, #baloo, bruns Cc: #frameworks, ashaposhnikov, michaelh, astippich, spoorun, ngraham, alexeymin