[clang] 59a2653 - [clang-format] Add parse tests for SeparateDefinitionBlocks option (#78256)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 12:22:08 PST 2024


Author: serbanu
Date: 2024-01-16T21:22:04+01:00
New Revision: 59a265311a072437232767c228263bea0c0074b5

URL: https://github.com/llvm/llvm-project/commit/59a265311a072437232767c228263bea0c0074b5
DIFF: https://github.com/llvm/llvm-project/commit/59a265311a072437232767c228263bea0c0074b5.diff

LOG: [clang-format] Add parse tests for SeparateDefinitionBlocks option (#78256)

Add config parse tests for SeparateDefinitionBlocks option.

Added: 
    

Modified: 
    clang/unittests/Format/ConfigParseTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp
index 6c0f9ddac5ac8f..172aaab5988ce5 100644
--- a/clang/unittests/Format/ConfigParseTest.cpp
+++ b/clang/unittests/Format/ConfigParseTest.cpp
@@ -996,6 +996,14 @@ TEST(ConfigParseTest, ParsesConfiguration) {
               FormatStyle::BBNSS_OnlyWithParen);
   CHECK_PARSE("AllowBreakBeforeNoexceptSpecifier: Never",
               AllowBreakBeforeNoexceptSpecifier, FormatStyle::BBNSS_Never);
+
+  Style.SeparateDefinitionBlocks = FormatStyle::SDS_Never;
+  CHECK_PARSE("SeparateDefinitionBlocks: Always", SeparateDefinitionBlocks,
+              FormatStyle::SDS_Always);
+  CHECK_PARSE("SeparateDefinitionBlocks: Leave", SeparateDefinitionBlocks,
+              FormatStyle::SDS_Leave);
+  CHECK_PARSE("SeparateDefinitionBlocks: Never", SeparateDefinitionBlocks,
+              FormatStyle::SDS_Never);
 }
 
 TEST(ConfigParseTest, ParsesConfigurationWithLanguages) {


        


More information about the cfe-commits mailing list