r284222 - Try to fix windows bot file path style failure caused by r284219.
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 14 03:10:27 PDT 2016
Author: ioeric
Date: Fri Oct 14 05:10:26 2016
New Revision: 284222
URL: http://llvm.org/viewvc/llvm-project?rev=284222&view=rev
Log:
Try to fix windows bot file path style failure caused by r284219.
Modified:
cfe/trunk/unittests/Tooling/RefactoringTest.cpp
Modified: cfe/trunk/unittests/Tooling/RefactoringTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/RefactoringTest.cpp?rev=284222&r1=284221&r2=284222&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/RefactoringTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/RefactoringTest.cpp Fri Oct 14 05:10:26 2016
@@ -974,20 +974,38 @@ TEST_F(MergeReplacementsTest, Overlappin
TEST(DeduplicateByFileTest, LeaveLeadingDotDot) {
std::map<std::string, Replacements> FileToReplaces;
+#if !defined(LLVM_ON_WIN32)
FileToReplaces["../../a/b/.././c.h"] = Replacements();
FileToReplaces["../../a/c.h"] = Replacements();
+#else
+ FileToReplaces["..\\..\\a\\b\\..\\.\\c.h"] = Replacements();
+ FileToReplaces["..\\..\\a\\c.h"] = Replacements();
+#endif
FileToReplaces = groupReplacementsByFile(FileToReplaces);
EXPECT_EQ(1u, FileToReplaces.size());
+#if !defined(LLVM_ON_WIN32)
EXPECT_EQ("../../a/c.h", FileToReplaces.begin()->first);
+#else
+ EXPECT_EQ("..\\..\\a\\c.h", FileToReplaces.begin()->first);
+#endif
}
TEST(DeduplicateByFileTest, RemoveDotSlash) {
std::map<std::string, Replacements> FileToReplaces;
+#if !defined(LLVM_ON_WIN32)
FileToReplaces["./a/b/.././c.h"] = Replacements();
FileToReplaces["a/c.h"] = Replacements();
+#else
+ FileToReplaces[".\\a\\b\\..\\.\\c.h"] = Replacements();
+ FileToReplaces["a\\c.h"] = Replacements();
+#endif
FileToReplaces = groupReplacementsByFile(FileToReplaces);
EXPECT_EQ(1u, FileToReplaces.size());
+#if !defined(LLVM_ON_WIN32)
EXPECT_EQ("a/c.h", FileToReplaces.begin()->first);
+#else
+ EXPECT_EQ("a\\c.h", FileToReplaces.begin()->first);
+#endif
}
} // end namespace tooling
More information about the cfe-commits
mailing list