From 291fd3504429f2fb8ca45e7f1430d30b7da4f477 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 23 Aug 2016 17:13:33 +0000 Subject: Change the PathMappingList::FindFile to use FileSpec API's Also, when appending path components, collapse multiple "/" into one at the join. llvm-svn: 279533 --- lldb/unittests/Host/FileSpecTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lldb/unittests/Host/FileSpecTest.cpp') 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()); -- cgit v1.2.3