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

Unified Diff: tools/gn/function_rebase_path_unittest.cc

Issue 213353004: GN: Move towards only using / on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: restore convert_slashes in output path, misc fixes Created 6 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/function_rebase_path.cc ('k') | tools/gn/ninja_binary_target_writer.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 a29d27064de8effbb3f69fb536a16ff3afecb5d4..0537d10d50aa296144c8ebf721b861e32ef906dc 100644
--- a/tools/gn/function_rebase_path_unittest.cc
+++ b/tools/gn/function_rebase_path_unittest.cc
@@ -13,14 +13,11 @@ namespace {
std::string RebaseOne(Scope* scope,
const char* input,
const char* to_dir,
- const char* from_dir,
- const char* sep = NULL) {
+ const char* from_dir) {
std::vector<Value> args;
args.push_back(Value(NULL, input));
args.push_back(Value(NULL, to_dir));
args.push_back(Value(NULL, from_dir));
- if (sep)
- args.push_back(Value(NULL, sep));
Err err;
FunctionCallNode function;
@@ -60,21 +57,17 @@ TEST(RebasePath, Strings) {
EXPECT_EQ("../foo", RebaseOne(scope, "//foo", "//foo", "//"));
// Test slash conversion.
- EXPECT_EQ("foo/bar", RebaseOne(scope, "foo/bar", ".", ".", "to_slash"));
- EXPECT_EQ("foo/bar", RebaseOne(scope, "foo\\bar", ".", ".", "to_slash"));
-#if defined(OS_WIN)
- EXPECT_EQ("foo\\bar", RebaseOne(scope, "foo/bar", ".", ".", "to_system"));
- EXPECT_EQ("foo\\bar", RebaseOne(scope, "foo\\bar", ".", ".", "to_system"));
-#endif
+ EXPECT_EQ("foo/bar", RebaseOne(scope, "foo/bar", ".", "."));
+ EXPECT_EQ("foo/bar", RebaseOne(scope, "foo\\bar", ".", "."));
// Test system path output.
#if defined(OS_WIN)
- setup.build_settings()->SetRootPath(base::FilePath(L"C:\\source"));
- EXPECT_EQ("C:\\source", RebaseOne(scope, ".", "", "//"));
- EXPECT_EQ("C:\\source\\", RebaseOne(scope, "//", "", "//"));
- EXPECT_EQ("C:\\source\\foo", RebaseOne(scope, "foo", "", "//"));
- EXPECT_EQ("C:\\source\\foo\\", RebaseOne(scope, "foo/", "", "//"));
- EXPECT_EQ("C:\\source\\tools\\gn\\foo", RebaseOne(scope, "foo", "", "."));
+ setup.build_settings()->SetRootPath(base::FilePath(L"C:/source"));
+ EXPECT_EQ("C:/source", RebaseOne(scope, ".", "", "//"));
+ EXPECT_EQ("C:/source/", RebaseOne(scope, "//", "", "//"));
+ EXPECT_EQ("C:/source/foo", RebaseOne(scope, "foo", "", "//"));
+ EXPECT_EQ("C:/source/foo/", RebaseOne(scope, "foo/", "", "//"));
+ EXPECT_EQ("C:/source/tools/gn/foo", RebaseOne(scope, "foo", "", "."));
#else
setup.build_settings()->SetRootPath(base::FilePath("/source"));
EXPECT_EQ("/source", RebaseOne(scope, ".", "", "//"));
« no previous file with comments | « tools/gn/function_rebase_path.cc ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698