| Index: lib/unittest/map_matchers.dart
|
| ===================================================================
|
| --- lib/unittest/map_matchers.dart (revision 10002)
|
| +++ lib/unittest/map_matchers.dart (working copy)
|
| @@ -12,7 +12,7 @@
|
|
|
| const _ContainsValue(this._value);
|
|
|
| - bool matches(item) => item.containsValue(_value);
|
| + bool matches(item, MatchState matchState) => item.containsValue(_value);
|
| Description describe(Description description) =>
|
| description.add('contains value ').addDescriptionOf(_value);
|
| }
|
| @@ -30,22 +30,25 @@
|
|
|
| const _ContainsMapping(this._key, Matcher this._valueMatcher);
|
|
|
| - bool matches(item) =>
|
| - item.containsKey(_key) && _valueMatcher.matches(item[_key]);
|
| + bool matches(item, MatchState matchState) =>
|
| + item.containsKey(_key) &&
|
| + _valueMatcher.matches(item[_key], matchState);
|
|
|
| Description describe(Description description) {
|
| return description.add('contains pair ').addDescriptionOf(_key).
|
| add(' => ').addDescriptionOf(_valueMatcher);
|
| }
|
|
|
| - Description describeMismatch(item, Description mismatchDescription) {
|
| + Description describeMismatch(item, Description mismatchDescription,
|
| + MatchState matchState, bool verbose) {
|
| if (!item.containsKey(_key)) {
|
| return mismatchDescription.addDescriptionOf(item).
|
| add(" doesn't contain key ").addDescriptionOf(_key);
|
| } else {
|
| mismatchDescription.add(' contains key ').addDescriptionOf(_key).
|
| add(' but with value ');
|
| - _valueMatcher.describeMismatch(item[_key], mismatchDescription);
|
| + _valueMatcher.describeMismatch(item[_key], mismatchDescription,
|
| + matchState, verbose);
|
| return mismatchDescription;
|
| }
|
| }
|
|
|