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

Unified Diff: test/backend/invoker_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 | « lib/src/runner/vm/isolate_test.dart ('k') | test/runner/browser/runner_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/backend/invoker_test.dart
diff --git a/test/backend/invoker_test.dart b/test/backend/invoker_test.dart
index 6cbe20d8649f1e424e78ac13803e9ee38d5d9005..7ba7c772f9216b45d20b0df691f9325777eae320 100644
--- a/test/backend/invoker_test.dart
+++ b/test/backend/invoker_test.dart
@@ -493,6 +493,20 @@ void main() {
async.elapse(new Duration(seconds: 30));
});
});
+
+ test("a test's prints are captured and reported", () {
+ expect(() {
+ var liveTest = _localTest(() {
+ print("Hello,");
+ return new Future(() => print("world!"));
+ }).load(suite);
+
+ expect(liveTest.onPrint.take(2).toList(),
+ completion(equals(["Hello,", "world!"])));
+
+ return liveTest.run();
+ }, prints(isEmpty));
+ });
}
LocalTest _localTest(body(), {tearDown()}) =>
« no previous file with comments | « lib/src/runner/vm/isolate_test.dart ('k') | test/runner/browser/runner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698