aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/Path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r--llvm/unittests/Support/Path.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index 11d53c8..cfba227 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -789,4 +789,14 @@ TEST(Support, NormalizePath) {
#undef EXPECT_PATH_IS
}
+
+TEST(Support, RemoveLeadingDotSlash) {
+ StringRef Path1("././/foolz/wat");
+ StringRef Path2("./////");
+
+ Path1 = path::remove_leading_dotslash(Path1);
+ EXPECT_EQ(Path1, "foolz/wat");
+ Path2 = path::remove_leading_dotslash(Path2);
+ EXPECT_EQ(Path2, "");
+}
} // anonymous namespace