Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tools/gn/filesystem_utils_unittest.cc

Issue 1817533002: Make rebase_path() aware of Windows drive letter capitalization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/filesystem_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/filesystem_utils_unittest.cc
diff --git a/tools/gn/filesystem_utils_unittest.cc b/tools/gn/filesystem_utils_unittest.cc
index d5638900e2e204802df6acb9cac974cc87194fb6..894b3da7d2393cc2549bd6ef020e34c7fa23a31d 100644
--- a/tools/gn/filesystem_utils_unittest.cc
+++ b/tools/gn/filesystem_utils_unittest.cc
@@ -488,6 +488,24 @@ TEST(FilesystemUtils, RebasePath) {
RebasePath("/path/to/foo", SourceDir("/source/root/a/b"),
base::StringPiece("/x/y/z")));
+#if defined(OS_WIN)
+ // Test corrections while rebasing Windows-style absolute paths.
+ EXPECT_EQ("../../../../path/to/foo",
+ RebasePath("C:/path/to/foo", SourceDir("//a/b"),
+ base::StringPiece("/C:/source/root")));
+ EXPECT_EQ("../../../../path/to/foo",
+ RebasePath("/C:/path/to/foo", SourceDir("//a/b"),
+ base::StringPiece("C:/source/root")));
+ EXPECT_EQ("../../../../path/to/foo",
+ RebasePath("/C:/path/to/foo", SourceDir("//a/b"),
+ base::StringPiece("/c:/source/root")));
+ EXPECT_EQ("../../../../path/to/foo",
+ RebasePath("/c:/path/to/foo", SourceDir("//a/b"),
+ base::StringPiece("c:/source/root")));
+ EXPECT_EQ("../../../../path/to/foo",
+ RebasePath("/c:/path/to/foo", SourceDir("//a/b"),
+ base::StringPiece("C:/source/root")));
+#endif
}
TEST(FilesystemUtils, DirectoryWithNoLastSlash) {
« no previous file with comments | « tools/gn/filesystem_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698