[PATCH] D66964: Sort Java imports without newline
Yannic Bonenberger via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 29 10:48:37 PDT 2019
yannic created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D66964
Files:
clang/unittests/Format/SortImportsTestJava.cpp
Index: clang/unittests/Format/SortImportsTestJava.cpp
===================================================================
--- clang/unittests/Format/SortImportsTestJava.cpp
+++ clang/unittests/Format/SortImportsTestJava.cpp
@@ -285,6 +285,25 @@
sortIncludes(FmtStyle, Code, GetCodeRange(Code), "input.java").empty());
}
+TEST_F(SortImportsTestJava, NoNewlineBetweenImports) {
+ EXPECT_EQ("import org.a;\n"
+ "import org.b;",
+ sort("import org.a;import org.b;"));
+ EXPECT_EQ("import org.a;\n"
+ "import org.b;",
+ sort("import org.b;import org.a;"));
+ EXPECT_EQ("import org.a;\n"
+ "import org.b;\n"
+ "import org.c",
+ sort("import org.b;import org.a;\n"
+ "import org.c;"));
+ EXPECT_EQ("import org.a;\n"
+ "import org.b;\n"
+ "import org.c",
+ sort("import org.c;\n"
+ "import org.b;import org.a;"));
+}
+
} // end namespace
} // end namespace format
} // end namespace clang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66964.217938.patch
Type: text/x-patch
Size: 1040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190829/77b4a4e1/attachment.bin>
More information about the cfe-commits
mailing list