Skip to content

Commit

Permalink
[unittest] Fix the FileSystem test on Windows. (Attempt #2)
Browse files Browse the repository at this point in the history
This fixes the double escaping and compares FileSpecs instead of
strings.

llvm-svn: 347725
  • Loading branch information
JDevlieghere committed Nov 28, 2018
1 parent 35f0e5c commit ee1eb52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lldb/unittests/Host/FileSystemTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ TEST(FileSystemTest, MakeAbsolute) {
auto EC = fs.MakeAbsolute(foo);
EXPECT_FALSE(EC);
#ifdef _WIN32
EXPECT_TRUE(foo.equals("\\\\foo"));
EXPECT_TRUE(foo.equals("\\foo"));
#else
EXPECT_TRUE(foo.equals("/foo"));
#endif
Expand All @@ -236,7 +236,7 @@ TEST(FileSystemTest, MakeAbsolute) {
FileSpec file_spec("foo");
auto EC = fs.MakeAbsolute(file_spec);
EXPECT_FALSE(EC);
EXPECT_EQ("/foo", file_spec.GetPath());
EXPECT_EQ(FileSpec("/foo"), file_spec);
}
}

Expand All @@ -248,7 +248,7 @@ TEST(FileSystemTest, Resolve) {
SmallString<16> foo(foo_relative);
fs.Resolve(foo);
#ifdef _WIN32
EXPECT_TRUE(foo.equals("\\\\foo"));
EXPECT_TRUE(foo.equals("\\foo"));
#else
EXPECT_TRUE(foo.equals("/foo"));
#endif
Expand All @@ -257,7 +257,7 @@ TEST(FileSystemTest, Resolve) {
{
FileSpec file_spec("foo");
fs.Resolve(file_spec);
EXPECT_EQ("/foo", file_spec.GetPath());
EXPECT_EQ(FileSpec("/foo"), file_spec);
}

{
Expand All @@ -270,7 +270,7 @@ TEST(FileSystemTest, Resolve) {
{
FileSpec file_spec("bogus");
fs.Resolve(file_spec);
EXPECT_EQ("bogus", file_spec.GetPath());
EXPECT_EQ(FileSpec("bogus"), file_spec);
}
}

Expand Down

0 comments on commit ee1eb52

Please sign in to comment.