Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: pkg/unittest/lib/src/collection_matchers.dart

Issue 12391076: Tweak mismatch description message to check for Iterable, not Collection. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698