[llvm] r252504 - Windows-specific test for sys::path::remove_dots.
Mike Aizatsky via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 9 11:36:54 PST 2015
Author: aizatsky
Date: Mon Nov 9 13:36:53 2015
New Revision: 252504
URL: http://llvm.org/viewvc/llvm-project?rev=252504&view=rev
Log:
Windows-specific test for sys::path::remove_dots.
Differential Revision: http://reviews.llvm.org/D14503
Modified:
llvm/trunk/unittests/Support/Path.cpp
Modified: llvm/trunk/unittests/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?rev=252504&r1=252503&r2=252504&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/Path.cpp (original)
+++ llvm/trunk/unittests/Support/Path.cpp Mon Nov 9 13:36:53 2015
@@ -853,6 +853,18 @@ static std::string remove_dots(StringRef
}
TEST(Support, RemoveDots) {
+#if defined(LLVM_ON_WIN32)
+ EXPECT_EQ("foolz\\wat", remove_dots(".\\.\\\\foolz\\wat", false));
+ EXPECT_EQ("", remove_dots(".\\\\\\\\\\", false));
+
+ EXPECT_EQ("a\\..\\b\\c", remove_dots(".\\a\\..\\b\\c", false));
+ EXPECT_EQ("b\\c", remove_dots(".\\a\\..\\b\\c", true));
+ EXPECT_EQ("c", remove_dots(".\\.\\c", true));
+
+ SmallString<64> Path1(".\\.\\c");
+ EXPECT_TRUE(path::remove_dots(Path1, true));
+ EXPECT_EQ("c", Path1);
+#else
EXPECT_EQ("foolz/wat", remove_dots("././/foolz/wat", false));
EXPECT_EQ("", remove_dots("./////", false));
@@ -863,5 +875,6 @@ TEST(Support, RemoveDots) {
SmallString<64> Path1("././c");
EXPECT_TRUE(path::remove_dots(Path1, true));
EXPECT_EQ("c", Path1);
+#endif
}
} // anonymous namespace
More information about the llvm-commits
mailing list