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 library matcher.map_matchers; | |
6 | |
7 import 'interfaces.dart'; | 5 import 'interfaces.dart'; |
8 import 'util.dart'; | 6 import 'util.dart'; |
9 | 7 |
10 /// Returns a matcher which matches maps containing the given [value]. | 8 /// Returns a matcher which matches maps containing the given [value]. |
11 Matcher containsValue(value) => new _ContainsValue(value); | 9 Matcher containsValue(value) => new _ContainsValue(value); |
12 | 10 |
13 class _ContainsValue extends Matcher { | 11 class _ContainsValue extends Matcher { |
14 final _value; | 12 final _value; |
15 | 13 |
16 const _ContainsValue(this._value); | 14 const _ContainsValue(this._value); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 mismatchDescription | 50 mismatchDescription |
53 .add(' contains key ') | 51 .add(' contains key ') |
54 .addDescriptionOf(_key) | 52 .addDescriptionOf(_key) |
55 .add(' but with value '); | 53 .add(' but with value '); |
56 _valueMatcher.describeMismatch( | 54 _valueMatcher.describeMismatch( |
57 item[_key], mismatchDescription, matchState, verbose); | 55 item[_key], mismatchDescription, matchState, verbose); |
58 return mismatchDescription; | 56 return mismatchDescription; |
59 } | 57 } |
60 } | 58 } |
61 } | 59 } |
OLD | NEW |