From 65688274b14f5d0e7dabbbaf9f3fd135646ef1d1 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 7 Oct 2024 19:12:47 -0700 Subject: [clang-format][NFC] Clean up AlignConsecutiveStyle (#111285) - Add a `CHECK_PARSE` for `AcrossComments`. - Add a `CHECK_PARSE_NESTED_BOOL` for `AlignFunctionPointers`. - Remove redundant statements. - Clean up documentation. --- clang/unittests/Format/ConfigParseTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/unittests/Format/ConfigParseTest.cpp') diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp index aa8fbb8..9abb8a1 100644 --- a/clang/unittests/Format/ConfigParseTest.cpp +++ b/clang/unittests/Format/ConfigParseTest.cpp @@ -317,6 +317,13 @@ TEST(ConfigParseTest, ParsesConfiguration) { /*AlignFunctionDeclarations=*/true, \ /*AlignFunctionPointers=*/false, /*PadOperators=*/true})); \ CHECK_PARSE( \ + #FIELD ": AcrossComments", FIELD, \ + FormatStyle::AlignConsecutiveStyle( \ + {/*Enabled=*/true, /*AcrossEmptyLines=*/false, \ + /*AcrossComments=*/true, /*AlignCompound=*/false, \ + /*AlignFunctionDeclarations=*/true, \ + /*AlignFunctionPointers=*/false, /*PadOperators=*/true})); \ + CHECK_PARSE( \ #FIELD ": AcrossEmptyLinesAndComments", FIELD, \ FormatStyle::AlignConsecutiveStyle( \ {/*Enabled=*/true, /*AcrossEmptyLines=*/true, \ @@ -339,6 +346,7 @@ TEST(ConfigParseTest, ParsesConfiguration) { CHECK_PARSE_NESTED_BOOL(FIELD, AcrossComments); \ CHECK_PARSE_NESTED_BOOL(FIELD, AlignCompound); \ CHECK_PARSE_NESTED_BOOL(FIELD, AlignFunctionDeclarations); \ + CHECK_PARSE_NESTED_BOOL(FIELD, AlignFunctionPointers); \ CHECK_PARSE_NESTED_BOOL(FIELD, PadOperators); \ } while (false) -- cgit v1.1