Skip to content

Commit

Permalink
[unittest] Fix unittests/Support/Path.cpp after D49466
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Nov 26, 2019
1 parent 6c92cdf commit fc6a690
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions llvm/unittests/Support/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,16 +1253,20 @@ TEST(Support, ReplacePathPrefix) {
path::replace_path_prefix(Path, OldPrefix, EmptyPrefix);
EXPECT_EQ(Path, "/foo");
Path = Path2;
path::replace_path_prefix(Path, OldPrefix, EmptyPrefix, true);
path::replace_path_prefix(Path, OldPrefix, EmptyPrefix, path::Style::native,
true);
EXPECT_EQ(Path, "foo");
Path = Path3;
path::replace_path_prefix(Path, OldPrefix, NewPrefix, false);
path::replace_path_prefix(Path, OldPrefix, NewPrefix, path::Style::native,
false);
EXPECT_EQ(Path, "/newnew/foo");
Path = Path3;
path::replace_path_prefix(Path, OldPrefix, NewPrefix, true);
path::replace_path_prefix(Path, OldPrefix, NewPrefix, path::Style::native,
true);
EXPECT_EQ(Path, "/oldnew/foo");
Path = Path3;
path::replace_path_prefix(Path, OldPrefixSep, NewPrefix, true);
path::replace_path_prefix(Path, OldPrefixSep, NewPrefix, path::Style::native,
true);
EXPECT_EQ(Path, "/oldnew/foo");
Path = Path1;
path::replace_path_prefix(Path, EmptyPrefix, NewPrefix);
Expand All @@ -1274,10 +1278,12 @@ TEST(Support, ReplacePathPrefix) {
path::replace_path_prefix(Path, OldPrefix, NewPrefix);
EXPECT_EQ(Path, "/new/");
Path = OldPrefix;
path::replace_path_prefix(Path, OldPrefixSep, NewPrefix, false);
path::replace_path_prefix(Path, OldPrefixSep, NewPrefix, path::Style::native,
false);
EXPECT_EQ(Path, "/old");
Path = OldPrefix;
path::replace_path_prefix(Path, OldPrefixSep, NewPrefix, true);
path::replace_path_prefix(Path, OldPrefixSep, NewPrefix, path::Style::native,
true);
EXPECT_EQ(Path, "/new");
}

Expand Down

0 comments on commit fc6a690

Please sign in to comment.