diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-27 23:26:40 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-27 23:26:40 +0000 |
commit | 858ceda682777affb22d41ee99adedeac946431b (patch) | |
tree | 50fb1d7d1f9a2661c3382a4d5f9a977f9240f62c /tools/gn/source_dir_unittest.cc | |
parent | 0329bef28e5938a0fc6a1953c313aac3f205f4eb (diff) | |
download | chromium_src-858ceda682777affb22d41ee99adedeac946431b.zip chromium_src-858ceda682777affb22d41ee99adedeac946431b.tar.gz chromium_src-858ceda682777affb22d41ee99adedeac946431b.tar.bz2 |
Do more slash normalization in GN.
This makes GN more aggressive about converting backslashes into forward-slashes, and makes the path handling functions mostly indifferent with regard to the two types of slashes.
The previous behavior was a bit confusing in that you would end up with strings like "//out\Debug/" on Windows, and certain operations on this would fail. With this change, the backslash will be more aggressively converted. The downside is that Posix filenames with literal backslashes in them are now unrepresentable in GN. But I think for a cross-platform system on constrained input (build files) this is a reasonable tradeoff for more consistent path handling.
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/177003008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/source_dir_unittest.cc')
-rw-r--r-- | tools/gn/source_dir_unittest.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/gn/source_dir_unittest.cc b/tools/gn/source_dir_unittest.cc index 6b3b6d2c..d2ea3aa 100644 --- a/tools/gn/source_dir_unittest.cc +++ b/tools/gn/source_dir_unittest.cc @@ -31,7 +31,7 @@ TEST(SourceDir, ResolveRelativeFile) { // This could potentially be changed in the future which would mean we should // just change the expected result. EXPECT_TRUE(base.ResolveRelativeFile("C:\\foo\\bar.txt") == - SourceFile("/C:\\foo\\bar.txt")); + SourceFile("/C:/foo/bar.txt")); #endif } @@ -55,6 +55,6 @@ TEST(SourceDir, ResolveRelativeDir) { // Note that we don't canonicalize the existing backslashes to forward // slashes. This could potentially be changed in the future which would mean // we should just change the expected result. - EXPECT_TRUE(base.ResolveRelativeDir("C:\\foo") == SourceDir("/C:\\foo/")); + EXPECT_TRUE(base.ResolveRelativeDir("C:\\foo") == SourceDir("/C:/foo/")); #endif } |