================ @@ -27628,6 +27628,109 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && condition2) {\n" + "}", + Style); + + verifyFormat("if (condition1 && condition2 &&\n" + " (condition3 || condition4) && condition5 &&\n" + " condition6) {\n" + "}", + Style); + + verifyFormat("if (loooooooooooooooooooooongcondition1 &&\n" + " loooooooooooooooooooooongcondition2) {\n" + "}", + Style); + + // Arithmetic + verifyFormat("const int result = lhs + rhs;\n", Style); ---------------- owenca wrote:
No trailing newline at the end of the test cases here and below. https://github.com/llvm/llvm-project/pull/95013 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits