Chromium Code Reviews| 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); |
|
Bob Nystrom
2012/10/22 16:57:49
I'm all for better error messages in future, but I
Siggi Cherem (dart-lang)
2012/10/22 17:23:54
The wrapping will only happen when the exception i
Jennifer Messerly
2012/10/22 20:51:25
Yeah, I think the idea is: if you handle the excep
|
| } |
| 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); |
| } |