Skip to content

Commit

Permalink
[clang-format][NFC] Remove extraneous newlines in some unit test files
Browse files Browse the repository at this point in the history
  • Loading branch information
owenca committed Oct 27, 2023
1 parent 4ec9cda commit 88934a8
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 160 deletions.
2 changes: 1 addition & 1 deletion clang/unittests/Format/ConfigParseTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ TEST(ConfigParseTest, ParsesConfiguration) {
" Priority: 2\n"
" - Regex: .*\n"
" Priority: 1\n"
" CaseSensitive: true\n",
" CaseSensitive: true",
IncludeStyle.IncludeCategories, ExpectedCategories);
CHECK_PARSE("IncludeIsMainRegex: 'abc$'", IncludeStyle.IncludeIsMainRegex,
"abc$");
Expand Down
4 changes: 2 additions & 2 deletions clang/unittests/Format/DefinitionBlockSeparatorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ TEST_F(DefinitionBlockSeparatorTest, Basic) {

verifyFormat("enum Foo { FOO, BAR };\n"
"\n"
"enum Bar { FOOBAR, BARFOO };\n",
"enum Bar { FOOBAR, BARFOO };",
Style);

FormatStyle BreakAfterReturnTypeStyle = Style;
Expand All @@ -158,7 +158,7 @@ TEST_F(DefinitionBlockSeparatorTest, Basic) {
" int r = t * p;\n"
" return r;\n"
" }\n"
"}\n",
"}",
BreakAfterReturnTypeStyle);
}

Expand Down
28 changes: 14 additions & 14 deletions clang/unittests/Format/FormatTestCSharp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,19 +530,19 @@ TEST_F(FormatTestCSharp, AttributesIndentation) {
verifyFormat("[SuppressMessage(\"A\", \"B\", Justification = \"C\")]\n"
"public override X Y()\n"
"{\n"
"}\n",
"}",
Style);

verifyFormat("[SuppressMessage]\n"
"public X Y()\n"
"{\n"
"}\n",
"}",
Style);

verifyFormat("[SuppressMessage]\n"
"public override X Y()\n"
"{\n"
"}\n",
"}",
Style);

verifyFormat("public A(B b) : base(b)\n"
Expand All @@ -551,7 +551,7 @@ TEST_F(FormatTestCSharp, AttributesIndentation) {
" public override X Y()\n"
" {\n"
" }\n"
"}\n",
"}",
Style);

verifyFormat("public A : Base\n"
Expand All @@ -560,7 +560,7 @@ TEST_F(FormatTestCSharp, AttributesIndentation) {
"[Test]\n"
"public Foo()\n"
"{\n"
"}\n",
"}",
Style);

verifyFormat("namespace\n"
Expand All @@ -572,7 +572,7 @@ TEST_F(FormatTestCSharp, AttributesIndentation) {
"public Foo()\n"
"{\n"
"}\n"
"}\n",
"}",
Style);
}

Expand Down Expand Up @@ -1561,15 +1561,15 @@ TEST_F(FormatTestCSharp, NamespaceIndentation) {
"public interface Name1\n"
"{\n"
"}\n"
"}\n",
"}",
Style);

verifyFormat("namespace A.B\n"
"{\n"
"public interface Name1\n"
"{\n"
"}\n"
"}\n",
"}",
Style);

Style.NamespaceIndentation = FormatStyle::NI_Inner;
Expand All @@ -1582,7 +1582,7 @@ TEST_F(FormatTestCSharp, NamespaceIndentation) {
" {\n"
" }\n"
"}\n"
"}\n",
"}",
Style);

Style.NamespaceIndentation = FormatStyle::NI_All;
Expand All @@ -1592,7 +1592,7 @@ TEST_F(FormatTestCSharp, NamespaceIndentation) {
" public interface Name1\n"
" {\n"
" }\n"
"}\n",
"}",
Style);

verifyFormat("namespace A\n"
Expand All @@ -1603,7 +1603,7 @@ TEST_F(FormatTestCSharp, NamespaceIndentation) {
" {\n"
" }\n"
" }\n"
"}\n",
"}",
Style);
}

Expand All @@ -1613,7 +1613,7 @@ TEST_F(FormatTestCSharp, SwitchExpression) {
" 1 => (0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0),\n"
" 2 => 1,\n"
" _ => 2\n"
"};\n",
"};",
Style);
}

Expand All @@ -1625,12 +1625,12 @@ TEST_F(FormatTestCSharp, EmptyShortBlock) {
" doA();\n"
"} catch (Exception e) {\n"
" e.printStackTrace();\n"
"}\n",
"}",
Style);

verifyFormat("try {\n"
" doA();\n"
"} catch (Exception e) {}\n",
"} catch (Exception e) {}",
Style);
}

Expand Down

0 comments on commit 88934a8

Please sign in to comment.