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

Unified Diff: lib/src/utils.dart

Issue 1196413003: Add a LoadSuite class. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 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: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 07d7df5dbb058d61ece4d91241c7d007f1183f4c..da20c3ec0c7e60a0da30c0a4653cc5778d03c97f 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -83,6 +83,12 @@ String getErrorMessage(error) =>
String indent(String str) =>
str.replaceAll(new RegExp("^", multiLine: true), " ");
+/// A regular expression matching terminal color codes.
+final _colorCode = new RegExp('\u001b\\[[0-9;]+m');
+
+/// Returns [str] without any color codes.
+String withoutColors(String str) => str.replaceAll(_colorCode, '');
+
/// A regular expression matching the path to a temporary file used to start an
/// isolate.
///

Powered by Google App Engine
This is Rietveld 408576698