summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r--clang/unittests/Format/SortImportsTestJava.cpp7
-rw-r--r--clang/unittests/Format/SortIncludesTest.cpp8
2 files changed, 15 insertions, 0 deletions
diff --git a/clang/unittests/Format/SortImportsTestJava.cpp b/clang/unittests/Format/SortImportsTestJava.cpp
index d2826a2107c..12869eeb54e 100644
--- a/clang/unittests/Format/SortImportsTestJava.cpp
+++ b/clang/unittests/Format/SortImportsTestJava.cpp
@@ -285,6 +285,13 @@ TEST_F(SortImportsTestJava, NoReplacementsForValidImports) {
sortIncludes(FmtStyle, Code, GetCodeRange(Code), "input.java").empty());
}
+TEST_F(SortImportsTestJava, NoReplacementsForValidImportsWindows) {
+ std::string Code = "import org.a;\r\n"
+ "import org.b;\r\n";
+ EXPECT_TRUE(
+ sortIncludes(FmtStyle, Code, GetCodeRange(Code), "input.java").empty());
+}
+
} // end namespace
} // end namespace format
} // end namespace clang
diff --git a/clang/unittests/Format/SortIncludesTest.cpp b/clang/unittests/Format/SortIncludesTest.cpp
index a33e440abfb..0c3a95a1063 100644
--- a/clang/unittests/Format/SortIncludesTest.cpp
+++ b/clang/unittests/Format/SortIncludesTest.cpp
@@ -724,6 +724,14 @@ TEST_F(SortIncludesTest, DoNotOutputReplacementsForSortedBlocksWithRegrouping) {
EXPECT_EQ(Code, sort(Code, "input.h", 0));
}
+TEST_F(SortIncludesTest,
+ DoNotOutputReplacementsForSortedBlocksWithRegroupingWindows) {
+ Style.IncludeBlocks = Style.IBS_Regroup;
+ std::string Code = "#include \"b.h\"\r\n"
+ "\r\n"
+ "#include <a.h>\r\n";
+ EXPECT_EQ(Code, sort(Code, "input.h", 0));
+}
TEST_F(SortIncludesTest, DoNotRegroupGroupsInGoogleObjCStyle) {
FmtStyle = getGoogleStyle(FormatStyle::LK_ObjC);
OpenPOWER on IntegriCloud