diff options
author | Owen Pan <owenpiano@gmail.com> | 2025-03-30 16:02:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-30 16:02:49 -0700 |
commit | e5fcbfa2aa8291a57e5eb03cd458935b458c73c0 (patch) | |
tree | 48ab5473058191bf46cef2f4228d5df78cdc806b /clang/unittests/Format/ConfigParseTest.cpp | |
parent | 2796e41ade306c3bf0f2e21311dff406bcf65652 (diff) | |
download | llvm-e5fcbfa2aa8291a57e5eb03cd458935b458c73c0.zip llvm-e5fcbfa2aa8291a57e5eb03cd458935b458c73c0.tar.gz llvm-e5fcbfa2aa8291a57e5eb03cd458935b458c73c0.tar.bz2 |
[clang-format] Add an option for editing enum trailing commas (#133576)
Also refactor the code that removes/replaces a token.
Diffstat (limited to 'clang/unittests/Format/ConfigParseTest.cpp')
-rw-r--r-- | clang/unittests/Format/ConfigParseTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp index 287191d..2b08b79 100644 --- a/clang/unittests/Format/ConfigParseTest.cpp +++ b/clang/unittests/Format/ConfigParseTest.cpp @@ -520,6 +520,14 @@ TEST(ConfigParseTest, ParsesConfiguration) { CHECK_PARSE("EmptyLineBeforeAccessModifier: Always", EmptyLineBeforeAccessModifier, FormatStyle::ELBAMS_Always); + Style.EnumTrailingComma = FormatStyle::ETC_Insert; + CHECK_PARSE("EnumTrailingComma: Leave", EnumTrailingComma, + FormatStyle::ETC_Leave); + CHECK_PARSE("EnumTrailingComma: Insert", EnumTrailingComma, + FormatStyle::ETC_Insert); + CHECK_PARSE("EnumTrailingComma: Remove", EnumTrailingComma, + FormatStyle::ETC_Remove); + Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak; CHECK_PARSE("AlignAfterOpenBracket: Align", AlignAfterOpenBracket, FormatStyle::BAS_Align); |