diff options
Diffstat (limited to 'clang/unittests/Tooling/RefactoringTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/RefactoringTest.cpp | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp index 080a0033..7ac5a1d 100644 --- a/clang/unittests/Tooling/RefactoringTest.cpp +++ b/clang/unittests/Tooling/RefactoringTest.cpp @@ -1513,17 +1513,21 @@ TEST_F(ApplyAtomicChangesTest, InsertsNewIncludesInRightOrder) { } TEST_F(ApplyAtomicChangesTest, RemoveAndSortIncludes) { - setInput("#include \"a\"\n" - "#include \"b\"\n" - "#include \"c\"\n" - "\n" - "int a;"); + setInput(R"( +#include "a" +#include "b" +#include "c" + +int a; + )"); Changes.emplace_back(FilePath, "key1"); Changes.back().removeHeader("b"); - EXPECT_EQ("#include \"a\"\n" - "#include \"c\"\n" - "\n" - "int a;", + EXPECT_EQ(R"( +#include "a" +#include "c" + +int a; + )", rewrite()); } TEST_F(ApplyAtomicChangesTest, InsertsSystemIncludes) { @@ -1549,19 +1553,23 @@ TEST_F(ApplyAtomicChangesTest, InsertsSystemIncludes) { } TEST_F(ApplyAtomicChangesTest, RemoveSystemIncludes) { - setInput("#include <a>\n" - "#include <b>\n" - "\n" - "#include \"c\"" - "\n" - "int a;"); + setInput(R"( +#include <a> +#include <b> + +#include "c" + +int a; + )"); Changes.emplace_back(FilePath, "key1"); Changes.back().removeHeader("<a>"); - EXPECT_EQ("#include <b>\n" - "\n" - "#include \"c\"" - "\n" - "int a;", + EXPECT_EQ(R"( +#include <b> + +#include "c" + +int a; + )", rewrite()); } |