ComputePathTo: Handle case where from == to.

This commit is contained in:
Henrik Rydgård 2023-01-02 22:07:14 +01:00
parent d8136adbed
commit 0e3cf9862e
3 changed files with 15 additions and 3 deletions

View file

@ -661,6 +661,9 @@ static bool TestPath() {
EXPECT_TRUE(Path("/").ComputePathTo(Path("/home/foo/bar"), computedPath));
EXPECT_EQ_STR(computedPath, std::string("home/foo/bar"));
EXPECT_TRUE(Path("/a/b").ComputePathTo(Path("/a/b"), computedPath));
EXPECT_EQ_STR(computedPath, std::string());
return true;
}