From 32d75fa293d9db70ddf8a20797e625f152b1efb5 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 21 Dec 2015 13:40:49 +0000 Subject: clang-format: Only try to find the "main" include in the first block of includes. llvm-svn: 256153 --- clang/unittests/Format/SortIncludesTest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'clang/unittests/Format/SortIncludesTest.cpp') diff --git a/clang/unittests/Format/SortIncludesTest.cpp b/clang/unittests/Format/SortIncludesTest.cpp index ce83091b715..d96227d13ee 100644 --- a/clang/unittests/Format/SortIncludesTest.cpp +++ b/clang/unittests/Format/SortIncludesTest.cpp @@ -191,6 +191,19 @@ TEST_F(SortIncludesTest, LeavesMainHeaderFirst) { "#include \"c.h\"\n" "#include \"b.h\"\n", "a.h")); + + // Only do this in the first #include block. + EXPECT_EQ("#include \n" + "\n" + "#include \"b.h\"\n" + "#include \"c.h\"\n" + "#include \"llvm/a.h\"\n", + sort("#include \n" + "\n" + "#include \"llvm/a.h\"\n" + "#include \"c.h\"\n" + "#include \"b.h\"\n", + "a.cc")); } TEST_F(SortIncludesTest, NegativePriorities) { -- cgit v1.2.3