diff options
Diffstat (limited to 'lldb/unittests/Utility/FileSpecTest.cpp')
| -rw-r--r-- | lldb/unittests/Utility/FileSpecTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/unittests/Utility/FileSpecTest.cpp b/lldb/unittests/Utility/FileSpecTest.cpp index fa9e8d07235..0f5b1652d29 100644 --- a/lldb/unittests/Utility/FileSpecTest.cpp +++ b/lldb/unittests/Utility/FileSpecTest.cpp @@ -189,6 +189,17 @@ TEST(FileSpecTest, EqualDotsPosixRoot) { } } +TEST(FileSpecTest, GuessPathStyle) { + EXPECT_EQ(FileSpec::Style::posix, FileSpec::GuessPathStyle("/foo/bar.txt")); + EXPECT_EQ(FileSpec::Style::posix, FileSpec::GuessPathStyle("//net/bar.txt")); + EXPECT_EQ(FileSpec::Style::windows, + FileSpec::GuessPathStyle(R"(C:\foo.txt)")); + EXPECT_EQ(FileSpec::Style::windows, + FileSpec::GuessPathStyle(R"(\\net\foo.txt)")); + EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("foo.txt")); + EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("foo/bar.txt")); +} + TEST(FileSpecTest, GetNormalizedPath) { std::pair<const char *, const char *> posix_tests[] = { {"/foo/.././bar", "/bar"}, |

