diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-01-10 10:36:59 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-01-10 10:36:59 +0000 |
commit | 22da134d98a8e88ad39fff0abf73754785d25a6b (patch) | |
tree | 64a36068dc38915ac429218a72ffc3a08ed5c911 /unittests/Basic | |
parent | ca8512adf86996f2080831941418e0c01068dd00 (diff) |
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
Diffstat (limited to 'unittests/Basic')
-rw-r--r-- | unittests/Basic/VirtualFileSystemTest.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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 |