Chromium Code Reviews| Index: pkg/scheduled_test/lib/src/scheduled_future_matchers.dart |
| diff --git a/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart b/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart |
| index 4e1d0ffb469456a86899577eddf15689157a3f66..0af9fefa43063762dbfc53875206e3cccac4366d 100644 |
| --- a/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart |
| +++ b/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart |
| @@ -6,6 +6,8 @@ library scheduled_future_matchers; |
| import 'dart:async'; |
| +import 'package:stack_trace/stack_trace.dart'; |
| + |
| import '../scheduled_test.dart'; |
| /// Matches a [Future] that completes successfully with a value. Note that this |
| @@ -60,8 +62,14 @@ class _ScheduledCompletes extends BaseMatcher { |
| } |
| } |
| + var outerTrace = new Trace.current(); |
| currentSchedule.wrapFuture(item.then((value) { |
| - if (_matcher != null) expect(value, _matcher); |
| + if (_matcher == null) return; |
| + try { |
|
Bob Nystrom
2013/04/01 17:30:49
Nit, but how about a blank line before the try?
nweiz
2013/04/01 20:46:03
Done.
|
| + expect(value, _matcher); |
| + } catch (e, stackTrace) { |
| + throw new AsyncError(e, outerTrace); |
| + } |
| }), description); |
| return true; |