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

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

Issue 145403005: pkg/unittest: formatter spin (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review nits Created 6 years, 10 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 | « pkg/unittest/lib/src/core_matchers.dart ('k') | pkg/unittest/lib/src/numeric_matchers.dart » ('j') | 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 unittest.matcher; 5 part of unittest.matcher;
6 6
7 /** 7 /**
8 * Returns a matcher which matches [Iterable]s in which all elements 8 * Returns a matcher which matches [Iterable]s in which all elements
9 * match the given [matcher]. 9 * match the given [matcher].
10 */ 10 */
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 abstract class _IterableMatcher extends Matcher { 138 abstract class _IterableMatcher extends Matcher {
139 const _IterableMatcher(); 139 const _IterableMatcher();
140 Description describeMismatch(item, Description mismatchDescription, 140 Description describeMismatch(item, Description mismatchDescription,
141 Map matchState, bool verbose) { 141 Map matchState, bool verbose) {
142 if (item is! Iterable) { 142 if (item is! Iterable) {
143 return mismatchDescription. 143 return mismatchDescription.
144 addDescriptionOf(item). 144 addDescriptionOf(item).
145 add(' not an Iterable'); 145 add(' not an Iterable');
146 } else { 146 } else {
147 return super.describeMismatch(item, mismatchDescription, matchState, 147 return super.describeMismatch(item, mismatchDescription, matchState,
148 verbose); 148 verbose);
149 } 149 }
150 } 150 }
151 } 151 }
152 152
153 /** 153 /**
154 * Returns a matcher which matches [Iterable]s whose elements match the matchers 154 * Returns a matcher which matches [Iterable]s whose elements match the matchers
155 * in [expected], but not necessarily in the same order. 155 * in [expected], but not necessarily in the same order.
156 * 156 *
157 * Note that this is `O(n^2)` and so should only be used on small objects. 157 * Note that this is `O(n^2)` and so should only be used on small objects.
158 */ 158 */
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 return mismatchDescription. 265 return mismatchDescription.
266 add('has '). 266 add('has ').
267 addDescriptionOf(matchState["actual"]). 267 addDescriptionOf(matchState["actual"]).
268 add(' which is not $_description '). 268 add(' which is not $_description ').
269 addDescriptionOf(matchState["expected"]). 269 addDescriptionOf(matchState["expected"]).
270 add(' at index ${matchState["index"]}'); 270 add(' at index ${matchState["index"]}');
271 } 271 }
272 } 272 }
273 } 273 }
274 274
OLDNEW
« no previous file with comments | « pkg/unittest/lib/src/core_matchers.dart ('k') | pkg/unittest/lib/src/numeric_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698