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

Unified Diff: tools/gn/label_pattern_unittest.cc

Issue 1742303002: Accept absolute Windows paths without leading slash in GN commands (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/label_pattern_unittest.cc
diff --git a/tools/gn/label_pattern_unittest.cc b/tools/gn/label_pattern_unittest.cc
index 19e253027e5517cc469932a182e5d4a08357a6c5..182b7501286743037ef97331ab6ed7ffcfdce721 100644
--- a/tools/gn/label_pattern_unittest.cc
+++ b/tools/gn/label_pattern_unittest.cc
@@ -58,6 +58,15 @@ TEST(LabelPattern, PatternParse) {
{ "//foo(//foo/bar:*)", false, LabelPattern::MATCH, "", "", "" },
{ "//foo/*(*)", false, LabelPattern::MATCH, "", "", "" },
{ "//foo(//bar", false, LabelPattern::MATCH, "", "", "" },
+ // Absolute paths.
+ { "/la/*", true, LabelPattern::RECURSIVE_DIRECTORY, "/la/", "", "" },
+ { "/la:bar", true, LabelPattern::MATCH, "/la/", "bar", "" },
+#if defined(OS_WIN)
+ { "/C:/la/*", true, LabelPattern::RECURSIVE_DIRECTORY, "/C:/la/", "", "" },
+ { "C:/la/*", true, LabelPattern::RECURSIVE_DIRECTORY, "/C:/la/", "", "" },
+ { "/C:/la:bar", true, LabelPattern::MATCH, "/C:/la/", "bar", "" },
+ { "C:/la:bar", true, LabelPattern::MATCH, "/C:/la/", "bar", "" },
+#endif
};
for (size_t i = 0; i < arraysize(cases); i++) {

Powered by Google App Engine
This is Rietveld 408576698