Index: tools/gn/source_dir_unittest.cc |
diff --git a/tools/gn/source_dir_unittest.cc b/tools/gn/source_dir_unittest.cc |
index 04684e6294f4559c90be2907fb235d62cd7d802d..0c73865ec9d6cd7d07df5df84fcc39dbf215e426 100644 |
--- a/tools/gn/source_dir_unittest.cc |
+++ b/tools/gn/source_dir_unittest.cc |
@@ -61,11 +61,41 @@ TEST(SourceDir, ResolveRelativeFile) { |
Value(nullptr, "../../foo"), &err, source_root) == |
SourceFile("/C:/source/foo")); |
EXPECT_FALSE(err.has_error()); |
+ |
+ EXPECT_TRUE(base.ResolveRelativeFile( |
+ Value(nullptr, "//../foo"), &err, source_root) == |
+ SourceFile("/C:/source/foo")); |
+ EXPECT_FALSE(err.has_error()); |
+ |
+ EXPECT_TRUE(base.ResolveRelativeFile( |
+ Value(nullptr, "//../root/foo"), &err, source_root) == |
+ SourceFile("/C:/source/root/foo")); |
+ EXPECT_FALSE(err.has_error()); |
+ |
+ EXPECT_TRUE(base.ResolveRelativeFile( |
+ Value(nullptr, "//../../../foo/bar"), &err, source_root) == |
+ SourceFile("/foo/bar")); |
+ EXPECT_FALSE(err.has_error()); |
#else |
EXPECT_TRUE(base.ResolveRelativeFile( |
Value(nullptr, "../../foo"), &err, source_root) == |
SourceFile("/source/foo")); |
EXPECT_FALSE(err.has_error()); |
+ |
+ EXPECT_TRUE(base.ResolveRelativeFile( |
+ Value(nullptr, "//../foo"), &err, source_root) == |
+ SourceFile("/source/foo")); |
+ EXPECT_FALSE(err.has_error()); |
+ |
+ EXPECT_TRUE(base.ResolveRelativeFile( |
+ Value(nullptr, "//../root/foo"), &err, source_root) == |
+ SourceFile("/source/root/foo")); |
+ EXPECT_FALSE(err.has_error()); |
+ |
+ EXPECT_TRUE(base.ResolveRelativeFile( |
+ Value(nullptr, "//../../../foo/bar"), &err, source_root) == |
+ SourceFile("/foo/bar")); |
+ EXPECT_FALSE(err.has_error()); |
#endif |
#if defined(OS_WIN) |
@@ -120,11 +150,27 @@ TEST(SourceDir, ResolveRelativeDir) { |
Value(nullptr, "../../foo"), &err, source_root) == |
SourceDir("/C:/source/foo/")); |
EXPECT_FALSE(err.has_error()); |
+ EXPECT_TRUE(base.ResolveRelativeDir( |
+ Value(nullptr, "//../foo"), &err, source_root) == |
+ SourceDir("/C:/source/foo/")); |
+ EXPECT_FALSE(err.has_error()); |
+ EXPECT_TRUE(base.ResolveRelativeDir( |
+ Value(nullptr, "//.."), &err, source_root) == |
+ SourceDir("/C:/source/")); |
+ EXPECT_FALSE(err.has_error()); |
#else |
EXPECT_TRUE(base.ResolveRelativeDir( |
Value(nullptr, "../../foo"), &err, source_root) == |
SourceDir("/source/foo/")); |
EXPECT_FALSE(err.has_error()); |
+ EXPECT_TRUE(base.ResolveRelativeDir( |
+ Value(nullptr, "//../foo"), &err, source_root) == |
+ SourceDir("/source/foo/")); |
+ EXPECT_FALSE(err.has_error()); |
+ EXPECT_TRUE(base.ResolveRelativeDir( |
+ Value(nullptr, "//.."), &err, source_root) == |
+ SourceDir("/source/")); |
+ EXPECT_FALSE(err.has_error()); |
#endif |
#if defined(OS_WIN) |