aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/ConfigParseTest.cpp
diff options
context:
space:
mode:
authorTom <pottagetom@gmail.com>2024-08-23 05:42:22 +0100
committerGitHub <noreply@github.com>2024-08-22 21:42:22 -0700
commit7c3237d778572931ff097e81df43d0bce9d1d4f8 (patch)
tree0864b8c8c74d39c9743cc43f987058edfd4b38ff /clang/unittests/Format/ConfigParseTest.cpp
parentfdaaa878443285e47a2cbc1b641ac04e2efa7881 (diff)
downloadllvm-7c3237d778572931ff097e81df43d0bce9d1d4f8.zip
llvm-7c3237d778572931ff097e81df43d0bce9d1d4f8.tar.gz
llvm-7c3237d778572931ff097e81df43d0bce9d1d4f8.tar.bz2
[clang-format] Change BinPackParameters to enum and add AlwaysOnePerLine (#101882)
Related issues that have requested this feature: #51833 #23796 #53190 Partially solves - this issue requests is for both arguments and parameters
Diffstat (limited to 'clang/unittests/Format/ConfigParseTest.cpp')
-rw-r--r--clang/unittests/Format/ConfigParseTest.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp
index 2ee0df9..b8bdfaa 100644
--- a/clang/unittests/Format/ConfigParseTest.cpp
+++ b/clang/unittests/Format/ConfigParseTest.cpp
@@ -160,7 +160,6 @@ TEST(ConfigParseTest, ParsesConfigurationBools) {
CHECK_PARSE_BOOL(AllowShortEnumsOnASingleLine);
CHECK_PARSE_BOOL(AllowShortLoopsOnASingleLine);
CHECK_PARSE_BOOL(BinPackArguments);
- CHECK_PARSE_BOOL(BinPackParameters);
CHECK_PARSE_BOOL(BreakAdjacentStringLiterals);
CHECK_PARSE_BOOL(BreakAfterJavaFieldAnnotations);
CHECK_PARSE_BOOL(BreakBeforeTernaryOperators);
@@ -436,6 +435,19 @@ TEST(ConfigParseTest, ParsesConfiguration) {
CHECK_PARSE("BreakBeforeInheritanceComma: true", BreakInheritanceList,
FormatStyle::BILS_BeforeComma);
+ Style.BinPackParameters = FormatStyle::BPPS_OnePerLine;
+ CHECK_PARSE("BinPackParameters: BinPack", BinPackParameters,
+ FormatStyle::BPPS_BinPack);
+ CHECK_PARSE("BinPackParameters: OnePerLine", BinPackParameters,
+ FormatStyle::BPPS_OnePerLine);
+ CHECK_PARSE("BinPackParameters: AlwaysOnePerLine", BinPackParameters,
+ FormatStyle::BPPS_AlwaysOnePerLine);
+ // For backward compatibility.
+ CHECK_PARSE("BinPackParameters: true", BinPackParameters,
+ FormatStyle::BPPS_BinPack);
+ CHECK_PARSE("BinPackParameters: false", BinPackParameters,
+ FormatStyle::BPPS_OnePerLine);
+
Style.PackConstructorInitializers = FormatStyle::PCIS_BinPack;
CHECK_PARSE("PackConstructorInitializers: Never", PackConstructorInitializers,
FormatStyle::PCIS_Never);