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

Unified Diff: test/frontend/matcher/completion_test.dart

Issue 1158463003: Don't wrap exceptions in complete or completes(). (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 7 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/frontend/future_matchers.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/frontend/matcher/completion_test.dart
diff --git a/test/frontend/matcher/completion_test.dart b/test/frontend/matcher/completion_test.dart
index 344d685aae6b67d7d8de921f83e982f9872e1f19..e5c73b56f9b5919fa5082d1dcbbd0abe69cbf56b 100644
--- a/test/frontend/matcher/completion_test.dart
+++ b/test/frontend/matcher/completion_test.dart
@@ -5,6 +5,7 @@
import 'dart:async';
import 'package:test/test.dart';
+import 'package:test/src/backend/state.dart';
import '../../utils.dart';
@@ -23,8 +24,10 @@ void main() {
expect(new Future.error('X'), completes);
});
- expectTestFailed(liveTest, startsWith(
- "Expected future to complete successfully, but it failed with X"));
+ expect(liveTest.state.status, equals(Status.complete));
+ expect(liveTest.state.result, equals(Result.error));
+ expect(liveTest.errors, hasLength(1));
+ expect(liveTest.errors.first.error, equals('X'));
});
test("with a failure", () async {
@@ -64,8 +67,10 @@ void main() {
expect(new Future.error('X'), completion(isNull));
});
- expectTestFailed(liveTest, startsWith(
- "Expected future to complete successfully, but it failed with X"));
+ expect(liveTest.state.status, equals(Status.complete));
+ expect(liveTest.state.result, equals(Result.error));
+ expect(liveTest.errors, hasLength(1));
+ expect(liveTest.errors.first.error, equals('X'));
});
test("with a failure", () async {
« no previous file with comments | « lib/src/frontend/future_matchers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698