From: Benjamin Kramer Date: Sun, 10 Jan 2016 10:36:59 +0000 (+0000) Subject: Make test work on windows by turning \ in paths back into /. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22da134d98a8e88ad39fff0abf73754785d25a6b;p=clang Make test work on windows by turning \ in paths back into /. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257286 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Basic/VirtualFileSystemTest.cpp b/unittests/Basic/VirtualFileSystemTest.cpp index b72b757b5f..3a638bbf7b 100644 --- a/unittests/Basic/VirtualFileSystemTest.cpp +++ b/unittests/Basic/VirtualFileSystemTest.cpp @@ -658,11 +658,17 @@ TEST_F(InMemoryFileSystemTest, WorkingDirectory) { Stat = FS.status("c"); ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString(); + auto ReplaceBackslashes = [](std::string S) { + std::replace(S.begin(), S.end(), '\\', '/'); + return S; + }; NormalizedFS.setCurrentWorkingDirectory("/b/c"); NormalizedFS.setCurrentWorkingDirectory("."); - ASSERT_EQ("/b/c", NormalizedFS.getCurrentWorkingDirectory().get()); + ASSERT_EQ("/b/c", ReplaceBackslashes( + NormalizedFS.getCurrentWorkingDirectory().get())); NormalizedFS.setCurrentWorkingDirectory(".."); - ASSERT_EQ("/b", NormalizedFS.getCurrentWorkingDirectory().get()); + ASSERT_EQ("/b", ReplaceBackslashes( + NormalizedFS.getCurrentWorkingDirectory().get())); } // NOTE: in the tests below, we use '//root/' as our root directory, since it is