diff options
author | Jim Ingham <jingham@apple.com> | 2016-08-23 17:13:33 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2016-08-23 17:13:33 +0000 |
commit | 291fd3504429f2fb8ca45e7f1430d30b7da4f477 (patch) | |
tree | 0511a668f5408d106fc9281478198697242a7e89 /lldb/unittests/Host/FileSpecTest.cpp | |
parent | 9ec5a61358fa7e5f4af389562a62400dd7201504 (diff) | |
download | bcm5719-llvm-291fd3504429f2fb8ca45e7f1430d30b7da4f477.tar.gz bcm5719-llvm-291fd3504429f2fb8ca45e7f1430d30b7da4f477.zip |
Change the PathMappingList::FindFile to use FileSpec API's
Also, when appending path components, collapse multiple "/" into one at the join.
llvm-svn: 279533
Diffstat (limited to 'lldb/unittests/Host/FileSpecTest.cpp')
-rw-r--r-- | lldb/unittests/Host/FileSpecTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/unittests/Host/FileSpecTest.cpp b/lldb/unittests/Host/FileSpecTest.cpp index 4e619529773..522f4bc69ea 100644 --- a/lldb/unittests/Host/FileSpecTest.cpp +++ b/lldb/unittests/Host/FileSpecTest.cpp @@ -69,6 +69,12 @@ TEST(FileSpecTest, AppendPathComponent) EXPECT_STREQ("/foo", fs_posix.GetDirectory().GetCString()); EXPECT_STREQ("bar", fs_posix.GetFilename().GetCString()); + FileSpec fs_posix_2("/foo", false, FileSpec::ePathSyntaxPosix); + fs_posix_2.AppendPathComponent("//bar/baz"); + EXPECT_STREQ("/foo/bar/baz", fs_posix_2.GetCString()); + EXPECT_STREQ("/foo/bar", fs_posix_2.GetDirectory().GetCString()); + EXPECT_STREQ("baz", fs_posix_2.GetFilename().GetCString()); + FileSpec fs_windows("F:\\bar", false, FileSpec::ePathSyntaxWindows); fs_windows.AppendPathComponent("baz"); EXPECT_STREQ("F:\\bar\\baz", fs_windows.GetCString()); |