=?utf-8?q?Tomáš?= Slanina <[email protected]>,
=?utf-8?q?Tomáš?= Slanina <[email protected]>,
=?utf-8?q?Tomáš?= Slanina <[email protected]>,
=?utf-8?q?Tomáš?= Slanina <[email protected]>,
=?utf-8?q?Tomáš?= Slanina <[email protected]>,
=?utf-8?q?Tomáš?= Slanina <[email protected]>,
=?utf-8?q?Tomáš?= Slanina <[email protected]>,
=?utf-8?q?Tomáš?= Slanina <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -15277,6 +15290,123 @@ TEST_F(FormatTest, NeverMergeShortRecords) {
Style);
}
+TEST_F(FormatTest, AllowShortRecordOnASingleLineNonSplit) {
+ FormatStyle Style = getLLVMStyle();
+
+ Style.BreakBeforeBraces = FormatStyle::BS_Custom;
+ Style.BraceWrapping.SplitEmptyRecord = false;
+
+ Style.AllowShortRecordOnASingleLine = FormatStyle::SRS_Never;
+ verifyFormat("class foo {\n"
+ " void bar();\n"
+ "};",
+ Style);
+ verifyFormat("class foo {\n};", Style);
+
+ Style.AllowShortRecordOnASingleLine = FormatStyle::SRS_EmptyIfAttached;
+ verifyFormat("class foo {\n"
+ " void bar();\n"
+ "};",
+ Style);
+ verifyFormat("class foo {};", Style);
----------------
owenca wrote:
Please move this up and change the assignment to:
```c++
EXPECT_EQ(Style.AllowShortRecordOnASingleLine,
FormatStyle::SRS_EmptyIfAttached);
```
https://github.com/llvm/llvm-project/pull/154580
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits