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

Unified Diff: test/runner/browser/runner_test.dart

Issue 1044953004: Gracefully handle tests that print. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 9 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 | « test/backend/invoker_test.dart ('k') | test/runner/compact_reporter_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/browser/runner_test.dart
diff --git a/test/runner/browser/runner_test.dart b/test/runner/browser/runner_test.dart
index bf90243369bfebac428fbb1ad3f440ae4903ce1b..2627a139bf620dbd0a1d1a32306a3cb2d53455c8 100644
--- a/test/runner/browser/runner_test.dart
+++ b/test/runner/browser/runner_test.dart
@@ -157,6 +157,25 @@ void main() {
expect(result.exitCode, equals(1));
});
});
+
+ test("forwards prints from the browser test", () {
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync("""
+import 'dart:async';
+
+import 'package:unittest/unittest.dart';
+
+void main() {
+ test("test", () {
+ print("Hello,");
+ return new Future(() => print("world!"));
+ });
+}
+""");
+
+ var result = _runUnittest(["-p", "chrome", "test.dart"]);
+ expect(result.stdout, contains("Hello,\nworld!\n"));
+ expect(result.exitCode, equals(0));
+ });
}
ProcessResult _runUnittest(List<String> args) =>
« no previous file with comments | « test/backend/invoker_test.dart ('k') | test/runner/compact_reporter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698