| 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 * Returns a matcher which matches [Collection]s in which all elements | 8 * Returns a matcher which matches [Collection]s in which all elements |
| 9 * match the given [matcher]. | 9 * match the given [matcher]. |
| 10 */ | 10 */ |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 | 183 |
| 184 /** | 184 /** |
| 185 * Collection matchers match against [Collection]s. We add this intermediate | 185 * Collection matchers match against [Collection]s. We add this intermediate |
| 186 * class to give better mismatch error messages than the base Matcher class. | 186 * class to give better mismatch error messages than the base Matcher class. |
| 187 */ | 187 */ |
| 188 abstract class _CollectionMatcher extends BaseMatcher { | 188 abstract class _CollectionMatcher extends BaseMatcher { |
| 189 const _CollectionMatcher(); | 189 const _CollectionMatcher(); |
| 190 Description describeMismatch(item, Description mismatchDescription, | 190 Description describeMismatch(item, Description mismatchDescription, |
| 191 MatchState matchState, bool verbose) { | 191 MatchState matchState, bool verbose) { |
| 192 if (item is !Collection) { | 192 if (item is! Iterable) { |
| 193 return mismatchDescription. | 193 return mismatchDescription. |
| 194 addDescriptionOf(item). | 194 addDescriptionOf(item). |
| 195 add(' not a collection'); | 195 add(' not an Iterable'); |
| 196 } else { | 196 } else { |
| 197 return super.describeMismatch(item, mismatchDescription, matchState, | 197 return super.describeMismatch(item, mismatchDescription, matchState, |
| 198 verbose); | 198 verbose); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 } | 201 } |
| OLD | NEW |