aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/ConfigParseTest.cpp
diff options
context:
space:
mode:
authordmasloff <74042473+dmasloff@users.noreply.github.com>2025-01-03 08:52:01 +0300
committerGitHub <noreply@github.com>2025-01-02 21:52:01 -0800
commit1c997feff16860ab6b21c5c03dc7ca65f300967f (patch)
tree1b5f02fc7672e2812003013c3a34906bb1510b64 /clang/unittests/Format/ConfigParseTest.cpp
parentb6c06d1a8d9b359e7319312a2a7654f0e7c6690c (diff)
downloadllvm-1c997feff16860ab6b21c5c03dc7ca65f300967f.zip
llvm-1c997feff16860ab6b21c5c03dc7ca65f300967f.tar.gz
llvm-1c997feff16860ab6b21c5c03dc7ca65f300967f.tar.bz2
[clang-format] Add option WrapNamespaceBodyWithNewlines (#106145)
It wraps the body of namespace with additional newlines, turning this code: ``` namespace N { int function(); } ``` into the following: ``` namespace N { int function(); } ``` --------- Co-authored-by: Owen Pan <owenpiano@gmail.com>
Diffstat (limited to 'clang/unittests/Format/ConfigParseTest.cpp')
-rw-r--r--clang/unittests/Format/ConfigParseTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp
index b249bf0..9c38dbb 100644
--- a/clang/unittests/Format/ConfigParseTest.cpp
+++ b/clang/unittests/Format/ConfigParseTest.cpp
@@ -865,6 +865,13 @@ TEST(ConfigParseTest, ParsesConfiguration) {
CHECK_PARSE("SortUsingDeclarations: true", SortUsingDeclarations,
FormatStyle::SUD_LexicographicNumeric);
+ CHECK_PARSE("WrapNamespaceBodyWithEmptyLines: Never",
+ WrapNamespaceBodyWithEmptyLines, FormatStyle::WNBWELS_Never);
+ CHECK_PARSE("WrapNamespaceBodyWithEmptyLines: Always",
+ WrapNamespaceBodyWithEmptyLines, FormatStyle::WNBWELS_Always);
+ CHECK_PARSE("WrapNamespaceBodyWithEmptyLines: Leave",
+ WrapNamespaceBodyWithEmptyLines, FormatStyle::WNBWELS_Leave);
+
// FIXME: This is required because parsing a configuration simply overwrites
// the first N elements of the list instead of resetting it.
Style.ForEachMacros.clear();