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

Unified Diff: tools/gn/function_rebase_path_unittest.cc

Issue 711113004: original (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win compile fix Created 6 years, 1 month 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/function_rebase_path.cc ('k') | tools/gn/function_write_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_rebase_path_unittest.cc
diff --git a/tools/gn/function_rebase_path_unittest.cc b/tools/gn/function_rebase_path_unittest.cc
index 0537d10d50aa296144c8ebf721b861e32ef906dc..0bf1811a273dcb3b29a0057185e766932dacdcfc 100644
--- a/tools/gn/function_rebase_path_unittest.cc
+++ b/tools/gn/function_rebase_path_unittest.cc
@@ -78,6 +78,33 @@ TEST(RebasePath, Strings) {
#endif
}
+TEST(RebasePath, StringsSystemPaths) {
+ TestWithScope setup;
+ Scope* scope = setup.scope();
+ setup.build_settings()->SetBuildDir(SourceDir("/ssd/out/Debug"));
+ setup.build_settings()->SetRootPath(base::FilePath("/hdd/src"));
+
+ // Test system absolute to-dir.
+ EXPECT_EQ("../../ssd/out/Debug",
+ RebaseOne(scope, ".", "//", "/ssd/out/Debug"));
+ EXPECT_EQ("../../ssd/out/Debug/",
+ RebaseOne(scope, "./", "//", "/ssd/out/Debug"));
+ EXPECT_EQ("../../ssd/out/Debug/foo",
+ RebaseOne(scope, "foo", "//", "/ssd/out/Debug"));
+ EXPECT_EQ("../../ssd/out/Debug/foo/",
+ RebaseOne(scope, "foo/", "//", "/ssd/out/Debug"));
+
+ // Test system absolute from-dir.
+ EXPECT_EQ("../../../hdd/src",
+ RebaseOne(scope, ".", "/ssd/out/Debug", "//"));
+ EXPECT_EQ("../../../hdd/src/",
+ RebaseOne(scope, "./", "/ssd/out/Debug", "//"));
+ EXPECT_EQ("../../../hdd/src/foo",
+ RebaseOne(scope, "foo", "/ssd/out/Debug", "//"));
+ EXPECT_EQ("../../../hdd/src/foo/",
+ RebaseOne(scope, "foo/", "/ssd/out/Debug", "//"));
+}
+
// Test list input.
TEST(RebasePath, List) {
TestWithScope setup;
« no previous file with comments | « tools/gn/function_rebase_path.cc ('k') | tools/gn/function_write_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698