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

Unified Diff: tests/corelib/future_test.dart

Issue 11226013: Improvement on future: add stack trace to unhandled failures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « tests/co19/co19-runtime.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/future_test.dart
diff --git a/tests/corelib/future_test.dart b/tests/corelib/future_test.dart
index ebc541f41faa7d3b956a650536f905704d7bfe99..9ed1db54ed8a38e398b61fb2691a54d1067b8f12 100644
--- a/tests/corelib/future_test.dart
+++ b/tests/corelib/future_test.dart
@@ -74,7 +74,7 @@ testExceptionWithCompleteHandlerBeforeComplete() {
completer.completeException(exception);
Expect.equals(exception, future.exception);
Expect.equals(exception, err);
- Expect.throws(() => future.value, (e) => e == exception);
+ Expect.throws(() => future.value, (e) => e.source == exception);
}
testCompleteWithCompleteHandlerAfterComplete() {
@@ -108,7 +108,7 @@ testExceptionWithCompleteHandlerAfterComplete() {
});
Expect.equals(exception, future.exception);
Expect.equals(exception, err);
- Expect.throws(() => future.value, (e) => e == exception);
+ Expect.throws(() => future.value, (e) => e.source == exception);
}
testCompleteWithManyCompleteHandlers() {
@@ -146,7 +146,7 @@ testExceptionWithManyCompleteHandlers() {
Expect.equals(exception, before);
Expect.equals(exception, after1);
Expect.equals(exception, after2);
- Expect.throws(() => future.value, (e) => e == exception);
+ Expect.throws(() => future.value, (e) => e.source == exception);
}
// Tests for [then]
@@ -207,7 +207,7 @@ testException() {
future.then((_) {}); // exception is thrown if we plan to use the value
Expect.throws(
() { completer.completeException(ex); },
- (e) => e == ex);
+ (e) => e.source == ex);
}
testExceptionNoSuccessListeners() {
@@ -263,7 +263,7 @@ testExceptionHandlerReturnsFalse() {
future.handleException((e) { reached = true; return false; }); // overshadowed
Expect.throws(
() { completer.completeException(ex); },
- (e) => e == ex);
+ (e) => e.source == ex);
Expect.isTrue(reached);
}
@@ -385,7 +385,7 @@ testExceptionWithCompletionAndSuccessHandlers() {
exceptionFromCompleteHandler = f.exception;
});
future.then((v) => Expect.fail("Should not succeed"));
- Expect.throws(() => completer.completeException(ex), (e) => ex == e);
+ Expect.throws(() => completer.completeException(ex), (e) => e.source == ex);
Expect.equals(ex, exceptionFromCompleteHandler);
}
@@ -438,7 +438,7 @@ testTransformTransformerFails() {
final transformedFuture = completer.future.transform((x) { throw error; });
Expect.isFalse(transformedFuture.isComplete);
transformedFuture.then((v) => null);
- Expect.throws(() => completer.complete("42"), (e) => e == error);
+ Expect.throws(() => completer.complete("42"), (e) => e.source == error);
Expect.equals(error, transformedFuture.exception);
}
@@ -478,7 +478,7 @@ testChainTransformerFails() {
});
chainedFuture.then((v) => null);
Expect.isFalse(chainedFuture.isComplete);
- Expect.throws(() => completerA.complete("42"), (e) => e == error);
+ Expect.throws(() => completerA.complete("42"), (e) => e.source == error);
Expect.equals(error, chainedFuture.exception);
}
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698