aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format
diff options
context:
space:
mode:
authorFilip Milosevic <54005272+MightyFilipns@users.noreply.github.com>2025-05-08 07:47:56 +0200
committerGitHub <noreply@github.com>2025-05-07 22:47:56 -0700
commit5df01abe191ff4f848566e239798a2b4d26e1cf4 (patch)
tree7e036cf27b95ac6b192dd759536984bb31f00415 /clang/unittests/Format
parent26572bad95f816a979ce70b4e1335c8438a96df2 (diff)
downloadllvm-5df01abe191ff4f848566e239798a2b4d26e1cf4.zip
llvm-5df01abe191ff4f848566e239798a2b4d26e1cf4.tar.gz
llvm-5df01abe191ff4f848566e239798a2b4d26e1cf4.tar.bz2
[clang-format] Add SpaceAfterOperatorKeyword option (#137610)
Add SpaceAfterOperatorKeyword option to clang-format
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r--clang/unittests/Format/ConfigParseTest.cpp1
-rw-r--r--clang/unittests/Format/FormatTest.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp
index f7ab554..bd27a9f 100644
--- a/clang/unittests/Format/ConfigParseTest.cpp
+++ b/clang/unittests/Format/ConfigParseTest.cpp
@@ -204,6 +204,7 @@ TEST(ConfigParseTest, ParsesConfigurationBools) {
CHECK_PARSE_BOOL(SpacesInContainerLiterals);
CHECK_PARSE_BOOL(SpaceAfterCStyleCast);
CHECK_PARSE_BOOL(SpaceAfterTemplateKeyword);
+ CHECK_PARSE_BOOL(SpaceAfterOperatorKeyword);
CHECK_PARSE_BOOL(SpaceAfterLogicalNot);
CHECK_PARSE_BOOL(SpaceBeforeAssignmentOperators);
CHECK_PARSE_BOOL(SpaceBeforeCaseColon);
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index f85e078..436beaf 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -17291,6 +17291,12 @@ TEST_F(FormatTest, CalculatesOriginalColumn) {
" comment */");
}
+TEST_F(FormatTest, SpaceAfterOperatorKeyword) {
+ auto SpaceAfterOperatorKeyword = getLLVMStyle();
+ SpaceAfterOperatorKeyword.SpaceAfterOperatorKeyword = true;
+ verifyFormat("bool operator ++(int a);", SpaceAfterOperatorKeyword);
+}
+
TEST_F(FormatTest, ConfigurableSpaceBeforeParens) {
FormatStyle NoSpace = getLLVMStyle();
NoSpace.SpaceBeforeParens = FormatStyle::SBPO_Never;