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

Unified Diff: utils/pub/utils.dart

Issue 10699068: Add numerous features to the Pub test infrastructure. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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: utils/pub/utils.dart
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
index 097f60ff68a31a67d38d5651b9c1a36cc01cc8dc..60f8ab09749a5303189b2d875dacc48554ed7633 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -100,3 +100,13 @@ String replace(String source, Pattern matcher, String fn(Match)) {
buffer.add(source.substring(start));
return buffer.toString();
}
+
+/**
+ * Returns whether or not [str] ends with [matcher].
+ */
+bool endsWithPattern(String str, Pattern matcher) {
+ for (var match in matcher.allMatches(str)) {
+ if (match.end() == str.length) return true;
+ }
+ return false;
+}
« no previous file with comments | « utils/pub/io.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | utils/tests/pub/test_pub.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698