From dec84e11399e4dab21755f23da5b0417edf05196 Mon Sep 17 00:00:00 2001 From: "Ariel J. Bernal" Date: Wed, 31 Jul 2013 04:00:28 +0000 Subject: Fixed path differences when using include/exclude headers Added function for removing relative operators from input paths. llvm-svn: 187481 --- .../unittests/cpp11-migrate/IncludeExcludeTest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'clang-tools-extra/unittests/cpp11-migrate/IncludeExcludeTest.cpp') diff --git a/clang-tools-extra/unittests/cpp11-migrate/IncludeExcludeTest.cpp b/clang-tools-extra/unittests/cpp11-migrate/IncludeExcludeTest.cpp index 7aea471c21a..ed0e9f70eab 100644 --- a/clang-tools-extra/unittests/cpp11-migrate/IncludeExcludeTest.cpp +++ b/clang-tools-extra/unittests/cpp11-migrate/IncludeExcludeTest.cpp @@ -52,6 +52,23 @@ TEST(IncludeExcludeTest, ParseString) { EXPECT_FALSE(IEManager.isFileIncluded("c/c2/c3/f.cpp")); } +TEST(IncludeExcludeTest, ParseStringCases) { + IncludeExcludeInfo IEManager; + llvm::error_code Err = IEManager.readListFromString( + /*include=*/ "a/.,b/b2/,c/c2/c3/../../c4/,d/d2/./d3/,/e/e2/.", + /*exclude=*/ ""); + + ASSERT_EQ(Err, llvm::error_code::success()); + + EXPECT_TRUE(IEManager.isFileIncluded("a/f.cpp")); + EXPECT_TRUE(IEManager.isFileIncluded("b/b2/f.cpp")); + EXPECT_TRUE(IEManager.isFileIncluded("c/c4/f.cpp")); + EXPECT_TRUE(IEManager.isFileIncluded("d/d2/d3/f.cpp")); + EXPECT_TRUE(IEManager.isFileIncluded("/e/e2/f.cpp")); + + EXPECT_FALSE(IEManager.isFileIncluded("c/c2/c3/f.cpp")); +} + // Utility for creating and filling files with data for IncludeExcludeFileTest // tests. struct InputFiles { -- cgit v1.2.3