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

Unified Diff: tools/gn/filesystem_utils_unittest.cc

Issue 247663006: Add more phony rules to GN build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
Index: tools/gn/filesystem_utils_unittest.cc
diff --git a/tools/gn/filesystem_utils_unittest.cc b/tools/gn/filesystem_utils_unittest.cc
index 3416e1659fca2e637f75b8339d1f390223d641b7..ec1a53e7633d04d11d67f9c662a403af830dadac 100644
--- a/tools/gn/filesystem_utils_unittest.cc
+++ b/tools/gn/filesystem_utils_unittest.cc
@@ -73,6 +73,23 @@ TEST(FilesystemUtils, FindDir) {
EXPECT_EQ("foo/bar/", FindDir(&input));
}
+TEST(FilesystemUtils, FindLastDirComponent) {
+ SourceDir empty;
+ EXPECT_EQ("", FindLastDirComponent(empty));
+
+ SourceDir root("/");
+ EXPECT_EQ("", FindLastDirComponent(root));
+
+ SourceDir srcroot("//");
+ EXPECT_EQ("", FindLastDirComponent(srcroot));
+
+ SourceDir regular1("//foo/");
+ EXPECT_EQ("foo", FindLastDirComponent(regular1));
+
+ SourceDir regular2("//foo/bar/");
+ EXPECT_EQ("bar", FindLastDirComponent(regular2));
+}
+
TEST(FilesystemUtils, IsPathAbsolute) {
EXPECT_TRUE(IsPathAbsolute("/foo/bar"));
EXPECT_TRUE(IsPathAbsolute("/"));

Powered by Google App Engine
This is Rietveld 408576698