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

Unified Diff: test/runner/compact_reporter_test.dart

Issue 983573002: Add support for running browser tests to the test runner. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 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: test/runner/compact_reporter_test.dart
diff --git a/test/runner/compact_reporter_test.dart b/test/runner/compact_reporter_test.dart
index c706dce54f4aeda1f6880dac1502d01471266432..a0e4f1d8a31b77f1103a8a87b5084dedf579e41d 100644
--- a/test/runner/compact_reporter_test.dart
+++ b/test/runner/compact_reporter_test.dart
@@ -10,8 +10,6 @@ import 'package:unittest/unittest.dart';
import '../io.dart';
-String _sandbox;
-
void main() {
test("reports when no tests are run", () {
return withTempDir((path) {
@@ -131,9 +129,7 @@ void main() {
});
}
-final _prefixLength = "XX:XX ".length;
-
-void _expectReport(String tests, String expected) {
+void _expectReport(String tests, String expected, {List<String> args}) {
var dart = """
import 'dart:async';
@@ -146,13 +142,15 @@ $tests
expect(withTempDir((path) {
new File(p.join(path, "test.dart")).writeAsStringSync(dart);
- var result = runUnittest(["test.dart"], workingDirectory: path);
+ if (args == null) args = [];
+ args = args.toList()..add("test.dart");
+ var result = runUnittest(args, workingDirectory: path);
// Convert CRs into newlines, remove excess trailing whitespace, and trim
// off timestamps.
var actual = result.stdout.trim().split(new RegExp(r"[\r\n]")).map((line) {
if (line.startsWith(" ") || line.isEmpty) return line.trimRight();
- return line.trim().substring(_prefixLength);
+ return line.trim().replaceFirst(new RegExp("^[0-9]{2}:[0-9]{2} "), "");
}).join("\n");
// Un-indent the expected string.

Powered by Google App Engine
This is Rietveld 408576698