Index: tools/gn/filesystem_utils_unittest.cc |
diff --git a/tools/gn/filesystem_utils_unittest.cc b/tools/gn/filesystem_utils_unittest.cc |
index d398366e69c6f8e27536d954d2167ec32ebb0b42..9f874ebd4f58a8840d5b7bc5e67b5dced66b31e5 100644 |
--- a/tools/gn/filesystem_utils_unittest.cc |
+++ b/tools/gn/filesystem_utils_unittest.cc |
@@ -505,6 +505,22 @@ TEST(FilesystemUtils, GetOutDirForSourceDir) { |
EXPECT_EQ("two/obj/foo/bar/", |
GetOutputDirForSourceDirAsOutputFile( |
&other_settings, SourceDir("//foo/bar/")).value()); |
+ |
+ // Absolute source path |
+ EXPECT_EQ("//out/Debug/obj/ABS_PATH/abs/", |
+ GetOutputDirForSourceDir( |
+ &default_settings, SourceDir("/abs")).value()); |
+ EXPECT_EQ("obj/ABS_PATH/abs/", |
+ GetOutputDirForSourceDirAsOutputFile( |
+ &default_settings, SourceDir("/abs")).value()); |
+#if defined(OS_WIN) |
+ EXPECT_EQ("//out/Debug/obj/ABS_PATH/C/abs/", |
+ GetOutputDirForSourceDir( |
+ &default_settings, SourceDir("/C:/abs")).value()); |
+ EXPECT_EQ("obj/ABS_PATH/C/abs/", |
+ GetOutputDirForSourceDirAsOutputFile( |
+ &default_settings, SourceDir("/C:/abs")).value()); |
+#endif |
} |
TEST(FilesystemUtils, GetGenDirForSourceDir) { |