summaryrefslogtreecommitdiffstats
path: root/unittests/Basic
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-01-09 16:33:16 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-01-09 16:33:16 +0000
commitd3306b717c211f177eaeec46afdb966894572f2b (patch)
tree9db43c7e878af9ed3266b71d228624babcbf7dea /unittests/Basic
parentd9228ef3ed3a24509ae7314610210f61432948a9 (diff)
[vfs] Normalize working directory if requested.
FixedCompilationDatabase sets the working dir to "." by default. For chdir(".") this is a noop but this lead to InMemoryFileSystem to create bogus paths. Fixes PR25327. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Basic')
-rw-r--r--unittests/Basic/VirtualFileSystemTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/Basic/VirtualFileSystemTest.cpp b/unittests/Basic/VirtualFileSystemTest.cpp
index ac07035d3e..b72b757b5f 100644
--- a/unittests/Basic/VirtualFileSystemTest.cpp
+++ b/unittests/Basic/VirtualFileSystemTest.cpp
@@ -657,6 +657,12 @@ TEST_F(InMemoryFileSystemTest, WorkingDirectory) {
Stat = FS.status("c");
ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
+
+ NormalizedFS.setCurrentWorkingDirectory("/b/c");
+ NormalizedFS.setCurrentWorkingDirectory(".");
+ ASSERT_EQ("/b/c", NormalizedFS.getCurrentWorkingDirectory().get());
+ NormalizedFS.setCurrentWorkingDirectory("..");
+ ASSERT_EQ("/b", NormalizedFS.getCurrentWorkingDirectory().get());
}
// NOTE: in the tests below, we use '//root/' as our root directory, since it is