| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of matcher; | 5 part of matcher; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * MatchState is a simple wrapper around an arbitrary object. | 8 * MatchState is a simple wrapper around an arbitrary object. |
| 9 * [Matcher] [matches] methods can use this to store useful | 9 * [Matcher] [matches] methods can use this to store useful |
| 10 * information upon match failures, and this information will | 10 * information upon match failures, and this information will |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 * by appending to [mismatchDescription]. | 43 * by appending to [mismatchDescription]. |
| 44 */ | 44 */ |
| 45 Description describe(Description mismatchDescription); | 45 Description describe(Description mismatchDescription); |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Generates a description of the matcher failed for a particular | 48 * Generates a description of the matcher failed for a particular |
| 49 * [item], by appending the description to [mismatchDescription]. | 49 * [item], by appending the description to [mismatchDescription]. |
| 50 * It does not check whether the [item] fails the match, as it is | 50 * It does not check whether the [item] fails the match, as it is |
| 51 * only called after a failed match. There may be additional info | 51 * only called after a failed match. There may be additional info |
| 52 * about the mismatch in [matchState]. | 52 * about the mismatch in [matchState]. |
| 53 * The base matcher does not add anything as the actual value is |
| 54 * typically sufficient, but matchers that can add valuable info |
| 55 * should override this. |
| 53 */ | 56 */ |
| 54 Description describeMismatch(item, Description mismatchDescription, | 57 Description describeMismatch(item, Description mismatchDescription, |
| 55 MatchState matchState, bool verbose) => | 58 MatchState matchState, bool verbose) => |
| 56 mismatchDescription.add('was ').addDescriptionOf(item); | 59 mismatchDescription; |
| 57 } | 60 } |
| OLD | NEW |