| Index: lib/unittest/core_matchers.dart
|
| ===================================================================
|
| --- lib/unittest/core_matchers.dart (revision 8626)
|
| +++ lib/unittest/core_matchers.dart (working copy)
|
| @@ -141,8 +141,6 @@
|
| * The value passed to expect() should be a reference to the function.
|
| * Note that the function cannot take arguments; to handle this
|
| * a wrapper will have to be created.
|
| - * The function will be called once upon success, or twice upon failure
|
| - * (the second time to get the failure description).
|
| */
|
| Matcher throwsA(Matcher matcher) => new _Throws(matcher);
|
|
|
| @@ -179,11 +177,11 @@
|
| }
|
|
|
| Description describeMismatch(item, Description mismatchDescription) {
|
| - try {
|
| - item();
|
| + if (_matcher == null) {
|
| return mismatchDescription.add(' no exception');
|
| - } catch (final e) {
|
| - return mismatchDescription.add(' exception does not match ').
|
| + } else {
|
| + return mismatchDescription.
|
| + add(' no exception or exception does not match ').
|
| addDescriptionOf(_matcher);
|
| }
|
| }
|
|
|