From c45343ea2805d22081305c2d05b3e7514f480944 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 14 Oct 2016 10:10:26 +0000 Subject: [PATCH] Try to fix windows bot file path style failure caused by r284219. llvm-svn: 284222 --- clang/unittests/Tooling/RefactoringTest.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp index bf50b7d..81f0f1d 100644 --- a/clang/unittests/Tooling/RefactoringTest.cpp +++ b/clang/unittests/Tooling/RefactoringTest.cpp @@ -974,20 +974,38 @@ TEST_F(MergeReplacementsTest, OverlappingRanges) { TEST(DeduplicateByFileTest, LeaveLeadingDotDot) { std::map 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 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 -- 2.7.4