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

Unified Diff: test/runner/compact_reporter_test.dart

Issue 1212313005: Continuously update the compact reporter's clock. (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
« no previous file with comments | « lib/src/runner/reporter/compact.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/compact_reporter_test.dart
diff --git a/test/runner/compact_reporter_test.dart b/test/runner/compact_reporter_test.dart
index 5cd972a800614627de524da1cd60ec4a6c01e4f8..528ca375c2ab41d44c879858f47aeea82980403f 100644
--- a/test/runner/compact_reporter_test.dart
+++ b/test/runner/compact_reporter_test.dart
@@ -369,10 +369,19 @@ $tests
// Convert CRs into newlines, remove excess trailing whitespace, and trim
// off timestamps.
+ var lastLine;
var actual = result.stdout.trim().split(new RegExp(r"[\r\n]")).map((line) {
if (line.startsWith(" ") || line.isEmpty) return line.trimRight();
- return line.trim().replaceFirst(new RegExp("^[0-9]{2}:[0-9]{2} "), "");
- }).join("\n");
+
+ var trimmed = line.trim()
+ .replaceFirst(new RegExp("^[0-9]{2}:[0-9]{2} "), "");
+
+ // Trim identical lines so the test isn't dependent on how fast each test
+ // runs.
+ if (trimmed == lastLine) return null;
+ lastLine = trimmed;
+ return trimmed;
+ }).where((line) => line != null).join("\n");
// Un-indent the expected string.
var indentation = expected.indexOf(new RegExp("[^ ]"));
« no previous file with comments | « lib/src/runner/reporter/compact.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698