[clang] 6c3bc91 - [clang-format][NFC] Remove more extraneous newlines in unit tests
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 27 02:22:46 PDT 2023
Author: Owen Pan
Date: 2023-10-27T02:22:36-07:00
New Revision: 6c3bc910588f962e49470098ccc3b13c29cae493
URL: https://github.com/llvm/llvm-project/commit/6c3bc910588f962e49470098ccc3b13c29cae493
DIFF: https://github.com/llvm/llvm-project/commit/6c3bc910588f962e49470098ccc3b13c29cae493.diff
LOG: [clang-format][NFC] Remove more extraneous newlines in unit tests
Also removed a duplicate test case.
Added:
Modified:
clang/unittests/Format/FormatTestObjC.cpp
clang/unittests/Format/FormatTestProto.cpp
clang/unittests/Format/FormatTestSelective.cpp
clang/unittests/Format/FormatTestTableGen.cpp
clang/unittests/Format/FormatTestTextProto.cpp
clang/unittests/Format/FormatTestVerilog.cpp
clang/unittests/Format/QualifierFixerTest.cpp
clang/unittests/Format/UsingDeclarationsSorterTest.cpp
Removed:
################################################################################
diff --git a/clang/unittests/Format/FormatTestObjC.cpp b/clang/unittests/Format/FormatTestObjC.cpp
index 84a3d240055ff68..cd4f9d934127bfd 100644
--- a/clang/unittests/Format/FormatTestObjC.cpp
+++ b/clang/unittests/Format/FormatTestObjC.cpp
@@ -62,35 +62,33 @@ TEST(FormatTestObjCStyle, DetectsObjCInHeaders) {
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_Cpp, Style->Language);
- Style = getStyle("{}", "a.h", "none", "@interface Foo\n at end\n");
+ Style = getStyle("{}", "a.h", "none", "@interface Foo\n at end");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
Style = getStyle("{}", "a.h", "none",
- "const int interface = 1;\nconst int end = 2;\n");
+ "const int interface = 1;\nconst int end = 2;");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_Cpp, Style->Language);
- Style = getStyle("{}", "a.h", "none", "@protocol Foo\n at end\n");
+ Style = getStyle("{}", "a.h", "none", "@protocol Foo\n at end");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
Style = getStyle("{}", "a.h", "none",
- "const int protocol = 1;\nconst int end = 2;\n");
+ "const int protocol = 1;\nconst int end = 2;");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_Cpp, Style->Language);
- Style = getStyle("{}", "a.h", "none", "typedef NS_ENUM(int, Foo) {};\n");
+ Style = getStyle("{}", "a.h", "none", "typedef NS_ENUM(int, Foo) {};");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
- Style =
- getStyle("{}", "a.h", "none", "typedef NS_CLOSED_ENUM(int, Foo) {};\n");
+ Style = getStyle("{}", "a.h", "none", "typedef NS_CLOSED_ENUM(int, Foo) {};");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
- Style =
- getStyle("{}", "a.h", "none", "typedef NS_ERROR_ENUM(int, Foo) {};\n");
+ Style = getStyle("{}", "a.h", "none", "typedef NS_ERROR_ENUM(int, Foo) {};");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
@@ -118,45 +116,43 @@ FOUNDATION_EXPORT void DoStuff(void);
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_Cpp, Style->Language);
- Style =
- getStyle("{}", "a.h", "none", "inline void Foo() { Log(@\"Foo\"); }\n");
+ Style = getStyle("{}", "a.h", "none", "inline void Foo() { Log(@\"Foo\"); }");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
- Style =
- getStyle("{}", "a.h", "none", "inline void Foo() { Log(\"Foo\"); }\n");
+ Style = getStyle("{}", "a.h", "none", "inline void Foo() { Log(\"Foo\"); }");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_Cpp, Style->Language);
Style =
- getStyle("{}", "a.h", "none", "inline void Foo() { id = @[1, 2, 3]; }\n");
+ getStyle("{}", "a.h", "none", "inline void Foo() { id = @[1, 2, 3]; }");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
Style = getStyle("{}", "a.h", "none",
- "inline void Foo() { id foo = @{1: 2, 3: 4, 5: 6}; }\n");
+ "inline void Foo() { id foo = @{1: 2, 3: 4, 5: 6}; }");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
Style = getStyle("{}", "a.h", "none",
- "inline void Foo() { int foo[] = {1, 2, 3}; }\n");
+ "inline void Foo() { int foo[] = {1, 2, 3}; }");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_Cpp, Style->Language);
// ObjC characteristic types.
- Style = getStyle("{}", "a.h", "none", "extern NSString *kFoo;\n");
+ Style = getStyle("{}", "a.h", "none", "extern NSString *kFoo;");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
- Style = getStyle("{}", "a.h", "none", "extern NSInteger Foo();\n");
+ Style = getStyle("{}", "a.h", "none", "extern NSInteger Foo();");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
- Style = getStyle("{}", "a.h", "none", "NSObject *Foo();\n");
+ Style = getStyle("{}", "a.h", "none", "NSObject *Foo();");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
- Style = getStyle("{}", "a.h", "none", "NSSet *Foo();\n");
+ Style = getStyle("{}", "a.h", "none", "NSSet *Foo();");
ASSERT_TRUE((bool)Style);
EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language);
}
@@ -187,7 +183,7 @@ TEST_F(FormatTestObjC, FormatObjCTryCatch) {
" @try {\n"
" } @finally {\n"
" }\n"
- "});\n");
+ "});");
}
TEST_F(FormatTestObjC, FormatObjCAutoreleasepool) {
@@ -196,7 +192,7 @@ TEST_F(FormatTestObjC, FormatObjCAutoreleasepool) {
"}\n"
"@autoreleasepool {\n"
" f();\n"
- "}\n");
+ "}");
Style.BreakBeforeBraces = FormatStyle::BS_Custom;
Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
verifyFormat("@autoreleasepool\n"
@@ -206,18 +202,18 @@ TEST_F(FormatTestObjC, FormatObjCAutoreleasepool) {
"@autoreleasepool\n"
"{\n"
" f();\n"
- "}\n");
+ "}");
}
TEST_F(FormatTestObjC, FormatObjCGenerics) {
Style.ColumnLimit = 40;
verifyFormat("int aaaaaaaaaaaaaaaa(\n"
" NSArray<aaaaaaaaaaaaaaaaaa *>\n"
- " aaaaaaaaaaaaaaaaa);\n");
+ " aaaaaaaaaaaaaaaaa);");
verifyFormat("int aaaaaaaaaaaaaaaa(\n"
" NSArray<aaaaaaaaaaaaaaaaaaa<\n"
" aaaaaaaaaaaaaaaa *> *>\n"
- " aaaaaaaaaaaaaaaaa);\n");
+ " aaaaaaaaaaaaaaaaa);");
}
TEST_F(FormatTestObjC, FormatObjCSynchronized) {
@@ -226,7 +222,7 @@ TEST_F(FormatTestObjC, FormatObjCSynchronized) {
"}\n"
"@synchronized(self) {\n"
" f();\n"
- "}\n");
+ "}");
Style.BreakBeforeBraces = FormatStyle::BS_Custom;
Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
verifyFormat("@synchronized(self)\n"
@@ -236,7 +232,7 @@ TEST_F(FormatTestObjC, FormatObjCSynchronized) {
"@synchronized(self)\n"
"{\n"
" f();\n"
- "}\n");
+ "}");
}
TEST_F(FormatTestObjC, FormatObjCInterface) {
@@ -409,7 +405,7 @@ TEST_F(FormatTestObjC, FormatObjCInterface) {
Style.ColumnLimit = 40;
// BinPackParameters should be true by default.
verifyFormat("void eeeeeeee(int eeeee, int eeeee,\n"
- " int eeeee, int eeeee);\n");
+ " int eeeee, int eeeee);");
// ObjCBinPackProtocolList should be BPS_Never by default.
verifyFormat("@interface fffffffffffff () <\n"
" fffffffffffff,\n"
@@ -511,7 +507,7 @@ TEST_F(FormatTestObjC, FormatObjCProtocol) {
"@end");
verifyFormat("@protocol Foo;\n"
- "@protocol Bar;\n");
+ "@protocol Bar;");
verifyFormat("@protocol Foo\n"
"@end\n"
@@ -530,7 +526,7 @@ TEST_F(FormatTestObjC, FormatObjCProtocol) {
"- (void)required;\n"
"@optional\n"
"@property(assign) int madProp;\n"
- "@end\n");
+ "@end");
verifyFormat("@property(nonatomic, assign, readonly)\n"
" int *looooooooooooooooooooooooooooongNumber;\n"
@@ -562,7 +558,7 @@ TEST_F(FormatTestObjC, FormatObjCMethodDeclarations) {
" evenLongerKeyword:(float)theInterval\n"
" error:(NSError **)theError {\n"
"}");
- verifyFormat("+ (instancetype)new;\n");
+ verifyFormat("+ (instancetype)new;");
Style.ColumnLimit = 60;
verifyFormat("- (instancetype)initXxxxxx:(id<x>)x\n"
" y:(id<yyyyyyyyyyyyyyyyyyyy>)y\n"
@@ -573,18 +569,18 @@ TEST_F(FormatTestObjC, FormatObjCMethodDeclarations) {
Style.ColumnLimit = 40;
// Make sure selectors with 0, 1, or more arguments are indented when wrapped.
verifyFormat("- (aaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaa;\n");
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaaa;");
verifyFormat("- (aaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a;\n");
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a;");
verifyFormat("- (aaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a;\n");
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a;");
verifyFormat("- (aaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a;\n");
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a;");
verifyFormat("- (aaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a;\n");
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaa:(int)a;");
// Continuation indent width should win over aligning colons if the function
// name is long.
@@ -618,7 +614,7 @@ TEST_F(FormatTestObjC, FormatObjCMethodDeclarations) {
"- (void)foo:(id)bar\n"
"{\n"
"}\n"
- "@end\n");
+ "@end");
}
TEST_F(FormatTestObjC, FormatObjCMethodExpr) {
@@ -1109,30 +1105,30 @@ TEST_F(FormatTestObjC, ObjCForIn) {
TEST_F(FormatTestObjC, ObjCCxxKeywords) {
verifyFormat("+ (instancetype)new {\n"
" return nil;\n"
- "}\n");
+ "}");
verifyFormat("+ (instancetype)myNew {\n"
" return [self new];\n"
- "}\n");
- verifyFormat("SEL NewSelector(void) { return @selector(new); }\n");
- verifyFormat("SEL MacroSelector(void) { return MACRO(new); }\n");
+ "}");
+ verifyFormat("SEL NewSelector(void) { return @selector(new); }");
+ verifyFormat("SEL MacroSelector(void) { return MACRO(new); }");
verifyFormat("+ (instancetype)delete {\n"
" return nil;\n"
- "}\n");
+ "}");
verifyFormat("+ (instancetype)myDelete {\n"
" return [self delete];\n"
- "}\n");
- verifyFormat("SEL DeleteSelector(void) { return @selector(delete); }\n");
- verifyFormat("SEL MacroSelector(void) { return MACRO(delete); }\n");
- verifyFormat("MACRO(new:)\n");
- verifyFormat("MACRO(delete:)\n");
- verifyFormat("foo = @{MACRO(new:) : MACRO(delete:)}\n");
+ "}");
+ verifyFormat("SEL DeleteSelector(void) { return @selector(delete); }");
+ verifyFormat("SEL MacroSelector(void) { return MACRO(delete); }");
+ verifyFormat("MACRO(new:)");
+ verifyFormat("MACRO(delete:)");
+ verifyFormat("foo = @{MACRO(new:) : MACRO(delete:)}");
verifyFormat("@implementation Foo\n"
"// Testing\n"
"- (Class)class {\n"
"}\n"
"- (void)foo {\n"
"}\n"
- "@end\n");
+ "@end");
verifyFormat("@implementation Foo\n"
"- (Class)class {\n"
"}\n"
@@ -1162,7 +1158,7 @@ TEST_F(FormatTestObjC, ObjCCxxKeywords) {
"// Testing\n"
"- (Class)class;\n"
"- (void)foo;\n"
- "@end\n");
+ "@end");
verifyFormat("@interface Foo\n"
"- (Class)class;\n"
"- (void)foo;\n"
@@ -1354,7 +1350,7 @@ TEST_F(FormatTestObjC, ObjCArrayLiterals) {
// (that raises -Wobjc-string-concatenation).
verifyFormat("NSArray *foo = @[\n"
" @\"aaaaaaaaaaaaaaaaaaaaaaaaaa\"\n"
- "];\n");
+ "];");
}
TEST_F(FormatTestObjC, BreaksCallStatementWhereSemiJustOverTheLimit) {
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp
index 5de40b6eae5973e..4a2d2d68248d375 100644
--- a/clang/unittests/Format/FormatTestProto.cpp
+++ b/clang/unittests/Format/FormatTestProto.cpp
@@ -201,7 +201,7 @@ TEST_F(FormatTestProto, DoesntWrapFileOptions) {
}
TEST_F(FormatTestProto, TrailingCommentAfterFileOption) {
- verifyFormat("option java_package = \"foo.pkg\"; // comment\n");
+ verifyFormat("option java_package = \"foo.pkg\"; // comment");
}
TEST_F(FormatTestProto, FormatsOptions) {
@@ -411,7 +411,7 @@ TEST_F(FormatTestProto, DoesntWrapPackageStatements) {
}
TEST_F(FormatTestProto, TrailingCommentAfterPackage) {
- verifyFormat("package foo.pkg; // comment\n");
+ verifyFormat("package foo.pkg; // comment");
}
TEST_F(FormatTestProto, FormatsService) {
diff --git a/clang/unittests/Format/FormatTestSelective.cpp b/clang/unittests/Format/FormatTestSelective.cpp
index da252eb2ae3c388..c21c9bfe6079056 100644
--- a/clang/unittests/Format/FormatTestSelective.cpp
+++ b/clang/unittests/Format/FormatTestSelective.cpp
@@ -185,13 +185,13 @@ TEST_F(FormatTestSelective, ContinueReindenting) {
"int c;\n"
"int d;\n"
"int e;\n"
- " int f;\n",
+ " int f;",
format("int i;\n"
" int b;\n"
" int c;\n"
" int d;\n"
"int e;\n"
- " int f;\n",
+ " int f;",
11, 0));
}
@@ -201,13 +201,13 @@ TEST_F(FormatTestSelective, ReindentClosingBrace) {
" int a;\n"
" int b;\n"
"}\n"
- " int c;\n",
+ " int c;",
format("int i;\n"
" int f(){\n"
"int a;\n"
"int b;\n"
" }\n"
- " int c;\n",
+ " int c;",
11, 0));
EXPECT_EQ("void f() {\n"
" if (foo) {\n"
@@ -216,7 +216,7 @@ TEST_F(FormatTestSelective, ReindentClosingBrace) {
" c();\n"
" }\n"
"int d;\n"
- "}\n",
+ "}",
format("void f() {\n"
" if (foo) {\n"
"b();\n"
@@ -224,7 +224,7 @@ TEST_F(FormatTestSelective, ReindentClosingBrace) {
"c();\n"
"}\n"
"int d;\n"
- "}\n",
+ "}",
13, 0));
EXPECT_EQ("int i = []() {\n"
" class C {\n"
@@ -232,14 +232,14 @@ TEST_F(FormatTestSelective, ReindentClosingBrace) {
" int b;\n"
" };\n"
" int c;\n"
- "};\n",
+ "};",
format("int i = []() {\n"
" class C{\n"
"int a;\n"
"int b;\n"
"};\n"
"int c;\n"
- " };\n",
+ " };",
17, 0));
}
diff --git a/clang/unittests/Format/FormatTestTableGen.cpp b/clang/unittests/Format/FormatTestTableGen.cpp
index 06029bd8c725fc7..123f47d6d7f884b 100644
--- a/clang/unittests/Format/FormatTestTableGen.cpp
+++ b/clang/unittests/Format/FormatTestTableGen.cpp
@@ -48,11 +48,11 @@ TEST_F(FormatTestTableGen, FormatStringBreak) {
" HelpText<\n"
" \"This is a very, very, very, very, \"\n"
" \"very, very, very, very, very, very, \"\n"
- " \"very long help string\">;\n");
+ " \"very long help string\">;");
}
TEST_F(FormatTestTableGen, NoSpacesInSquareBracketLists) {
- verifyFormat("def flag : Flag<[\"-\", \"--\"], \"foo\">;\n");
+ verifyFormat("def flag : Flag<[\"-\", \"--\"], \"foo\">;");
}
} // namespace format
diff --git a/clang/unittests/Format/FormatTestTextProto.cpp b/clang/unittests/Format/FormatTestTextProto.cpp
index 6df8d4512792279..23f46202a34637c 100644
--- a/clang/unittests/Format/FormatTestTextProto.cpp
+++ b/clang/unittests/Format/FormatTestTextProto.cpp
@@ -370,7 +370,7 @@ TEST_F(FormatTestTextProto, UnderstandsHashComments) {
"### another triple-hash comment\n"
"#### a quadriple-hash comment\n"
"dd: 100\n"
- "#### another quadriple-hash comment\n",
+ "#### another quadriple-hash comment",
format("aaa: 100\n"
"##this is a double-hash comment.\n"
"bb: 100\n"
@@ -380,7 +380,7 @@ TEST_F(FormatTestTextProto, UnderstandsHashComments) {
"### another triple-hash comment\n"
"####a quadriple-hash comment\n"
"dd: 100\n"
- "#### another quadriple-hash comment\n",
+ "#### another quadriple-hash comment",
Style));
// Ensure we support a common pattern for naming sections.
@@ -540,7 +540,7 @@ TEST_F(FormatTestTextProto, AcceptsOperatorAsKey) {
TEST_F(FormatTestTextProto, BreaksConsecutiveStringLiterals) {
verifyFormat("ala: \"str1\"\n"
- " \"str2\"\n");
+ " \"str2\"");
}
TEST_F(FormatTestTextProto, PutsMultipleEntriesInExtensionsOnNewlines) {
@@ -669,7 +669,7 @@ TEST_F(FormatTestTextProto, BreaksEntriesOfSubmessagesContainingSubmessages) {
" key: 1\n"
" sub: {}\n"
"}\n"
- "# comment\n");
+ "# comment");
verifyFormat("sub: {\n"
" key: 1\n"
" # comment\n"
diff --git a/clang/unittests/Format/FormatTestVerilog.cpp b/clang/unittests/Format/FormatTestVerilog.cpp
index 4c0a065daadd9ad..1c2692467987d9b 100644
--- a/clang/unittests/Format/FormatTestVerilog.cpp
+++ b/clang/unittests/Format/FormatTestVerilog.cpp
@@ -229,12 +229,12 @@ TEST_F(FormatTestVerilog, Case) {
" 16'd1: fork\n"
" result = 10'b1011111111;\n"
" join\n"
- "endcase\n");
+ "endcase");
verifyFormat("case (data)\n"
" 16'd1: fork : x\n"
" result = 10'b1011111111;\n"
" join : x\n"
- "endcase\n");
+ "endcase");
// Test default.
verifyFormat("case (data)\n"
" default\n"
@@ -300,17 +300,17 @@ TEST_F(FormatTestVerilog, Case) {
verifyFormat("case ('{x : x, default : 9})\n"
"endcase",
Style);
- verifyFormat("x = '{x : x, default : 9};\n", Style);
+ verifyFormat("x = '{x : x, default : 9};", Style);
verifyFormat("default:\n"
- " x = '{x : x, default : 9};\n",
+ " x = '{x : x, default : 9};",
Style);
Style.SpacesInContainerLiterals = false;
verifyFormat("case ('{x: x, default: 9})\n"
"endcase",
Style);
- verifyFormat("x = '{x: x, default: 9};\n", Style);
+ verifyFormat("x = '{x: x, default: 9};", Style);
verifyFormat("default:\n"
- " x = '{x: x, default: 9};\n",
+ " x = '{x: x, default: 9};",
Style);
// When the line following the case label needs to be broken, the continuation
// should be indented correctly.
@@ -657,7 +657,7 @@ TEST_F(FormatTestVerilog, Hierarchy) {
" implements x, x, x;\n"
" generate\n"
" endgenerate\n"
- "endclass : x\n");
+ "endclass : x");
verifyFormat("function automatic logic [1 : 0] x\n"
" (input x);\n"
" generate\n"
diff --git a/clang/unittests/Format/QualifierFixerTest.cpp b/clang/unittests/Format/QualifierFixerTest.cpp
index a8f38593e5c40d8..73814e7414f5e7d 100644
--- a/clang/unittests/Format/QualifierFixerTest.cpp
+++ b/clang/unittests/Format/QualifierFixerTest.cpp
@@ -345,7 +345,6 @@ TEST_F(QualifierFixerTest, RightQualifier) {
"bool tools::addXRayRuntime(const ToolChain&TC, const ArgList &Args) {",
Style);
verifyFormat("Foo<Foo<int> const> P;", "Foo<const Foo<int>> P;", Style);
- verifyFormat("Foo<Foo<int> const> P;\n", "Foo<const Foo<int>> P;\n", Style);
verifyFormat("Foo<Foo<int> const> P;\n#if 0\n#else\n#endif",
"Foo<const Foo<int>> P;\n#if 0\n#else\n#endif", Style);
@@ -1254,17 +1253,17 @@ TEST_F(QualifierFixerTest, DisableRegions) {
ReplacementCount = 0;
verifyFormat("// clang-format off\n"
"int const inline static a = 0;\n"
- "// clang-format on\n",
+ "// clang-format on",
Style);
EXPECT_EQ(ReplacementCount, 0);
verifyFormat("// clang-format off\n"
"int const inline static a = 0;\n"
"// clang-format on\n"
- "inline static const int a = 0;\n",
+ "inline static const int a = 0;",
"// clang-format off\n"
"int const inline static a = 0;\n"
"// clang-format on\n"
- "int const inline static a = 0;\n",
+ "int const inline static a = 0;",
Style);
}
diff --git a/clang/unittests/Format/UsingDeclarationsSorterTest.cpp b/clang/unittests/Format/UsingDeclarationsSorterTest.cpp
index 6bfee7dd16cc03b..c0c0de7076fe6f7 100644
--- a/clang/unittests/Format/UsingDeclarationsSorterTest.cpp
+++ b/clang/unittests/Format/UsingDeclarationsSorterTest.cpp
@@ -784,7 +784,7 @@ TEST_F(UsingDeclarationsSorterTest,
"using std::chrono::duration_cast;\n"
"using std::chrono::microseconds;\n"
"using std::chrono::seconds;\n"
- "using std::chrono::steady_clock;\n",
+ "using std::chrono::steady_clock;",
sortUsingDeclarations("using boost::regex;\n"
"using boost::regex_constants::icase;\n"
"using std::chrono::duration_cast;\n"
@@ -792,7 +792,7 @@ TEST_F(UsingDeclarationsSorterTest,
"using std::chrono::seconds;\n"
"using std::chrono::steady_clock;\n"
"using std::move;\n"
- "using std::string;\n",
+ "using std::string;",
Style));
Style.SortUsingDeclarations = FormatStyle::SUD_Lexicographic;
@@ -803,7 +803,7 @@ TEST_F(UsingDeclarationsSorterTest,
"using std::chrono::seconds;\n"
"using std::chrono::steady_clock;\n"
"using std::move;\n"
- "using std::string;\n",
+ "using std::string;",
sortUsingDeclarations("using boost::regex;\n"
"using boost::regex_constants::icase;\n"
"using std::move;\n"
@@ -811,7 +811,7 @@ TEST_F(UsingDeclarationsSorterTest,
"using std::chrono::duration_cast;\n"
"using std::chrono::microseconds;\n"
"using std::chrono::seconds;\n"
- "using std::chrono::steady_clock;\n",
+ "using std::chrono::steady_clock;",
Style));
}
More information about the cfe-commits
mailing list