================
@@ -403,13 +416,25 @@ TEST_F(FormatTestComments, UnderstandsBlockComments) {
verifyFormat("f(/* aaaaaaaaaaaaaaaaaa = */\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);");
- FormatStyle NoBinPacking = getLLVMStyle();
- NoBinPacking.BinPackParameters = false;
- verifyFormat("aaaaaaaa(/* parameter 1 */ aaaaaa,\n"
- " /* parameter 2 */ aaaaaa,\n"
- " /* parameter 3 */ aaaaaa,\n"
- " /* parameter 4 */ aaaaaa);",
- NoBinPacking);
+ FormatStyle BinPack = getLLVMStyle();
+ verifyFormat(
+ "int aaaaaaaaaaaaa(/* 1st */ int bbbbbbbbbb, /* 2nd */ int
ccccccccccc,\n"
+ " /* 3rd */ int dddddddddddd);",
+ BinPack);
+
+ FormatStyle OnePerLine = getLLVMStyle();
+ OnePerLine.BinPackParameters = FormatStyle::BPPS_OnePerLine;
+ verifyFormat("int a(/* 1st */ int b, /* 2nd */ int c);", OnePerLine);
+ verifyFormat("int aaaaaaaaaaaaa(/* 1st */ int bbbbbbbbbb,\n"
+ " /* 2nd */ int ccccccccccc,\n"
+ " /* 3rd */ int dddddddddddd);",
+ OnePerLine);
+
+ FormatStyle AlwaysOnePerLine = getLLVMStyle();
+ AlwaysOnePerLine.BinPackParameters = FormatStyle::BPPS_AlwaysOnePerLine;
+ verifyFormat("int a(/* 1st */ int b,\n"
+ " /* 2nd */ int c);",
+ AlwaysOnePerLine);
----------------
owenca wrote:
> In the old test that was deleted it's setting the `Style.BinPackParameters =
> false;` but testing with a function call. Should it be using
> `Style.BinPackArguments = false;` instead?
Sorry that I forgot to change it in my suggestion above.
https://github.com/llvm/llvm-project/pull/101882
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits