[clang] [clang-format] Add parse tests for SeparateDefinitionBlocks option (PR #78256)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 16 02:57:20 PST 2024
https://github.com/seranu created https://github.com/llvm/llvm-project/pull/78256
Add config parse tests for SeparateDefinitionBlocks option.
>From 5399fad41b3898abe0833e283101aa34e76389b9 Mon Sep 17 00:00:00 2001
From: Serban Ungureanu <serban.ungureanu at randstaddigital.com>
Date: Tue, 16 Jan 2024 12:56:10 +0200
Subject: [PATCH] [clang-format] Add parse tests for SeparateDefinitionBlocks
option
---
clang/unittests/Format/ConfigParseTest.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp
index 6c0f9ddac5ac8f..f409a6a946f3d9 100644
--- a/clang/unittests/Format/ConfigParseTest.cpp
+++ b/clang/unittests/Format/ConfigParseTest.cpp
@@ -996,6 +996,15 @@ 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