Chromium Code Reviews| Index: pkg/unittest/lib/src/future_matchers.dart |
| =================================================================== |
| --- pkg/unittest/lib/src/future_matchers.dart (revision 19339) |
| +++ pkg/unittest/lib/src/future_matchers.dart (working copy) |
| @@ -34,8 +34,7 @@ |
| final Matcher _matcher; |
| final String _id; |
| - const _Completes(this._matcher, String id) |
| - : this._id = (id == '') ? '' : '$id '; |
| + const _Completes(this._matcher, this._id); |
| bool matches(item, MatchState matchState) { |
| if (item is! Future) return false; |
| @@ -44,7 +43,8 @@ |
| item.then((value) { |
| done(() { if (_matcher != null) expect(value, _matcher); }); |
| }, onError: (e) { |
| - var reason = 'Expected future ${_id}to complete successfully, ' |
| + var id = _id == '' ? '' : '${_id} '; |
|
Siggi Cherem (dart-lang)
2013/03/01 22:17:15
I was actually going to suggest this anyways, but
|
| + var reason = 'Expected future ${id}to complete successfully, ' |
| 'but it failed with ${e.error}'; |
| if (e.stackTrace != null) { |
| var stackTrace = e.stackTrace.toString(); |