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

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

Issue 438473002: pkg/matcher: refactored code around data-structure vs execution-based matchers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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/matcher/lib/src/interfaces.dart ('k') | pkg/matcher/lib/src/map_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 library matcher.iterable_matchers; 5 library matcher.iterable_matchers;
6 6
7 import 'core_matchers.dart'; 7 import 'core_matchers.dart';
8 import 'description.dart'; 8 import 'description.dart';
9 import 'expect.dart';
10 import 'interfaces.dart'; 9 import 'interfaces.dart';
10 import 'util.dart';
11 11
12 /// Returns a matcher which matches [Iterable]s in which all elements 12 /// Returns a matcher which matches [Iterable]s in which all elements
13 /// match the given [matcher]. 13 /// match the given [matcher].
14 Matcher everyElement(matcher) => new _EveryElement(wrapMatcher(matcher)); 14 Matcher everyElement(matcher) => new _EveryElement(wrapMatcher(matcher));
15 15
16 class _EveryElement extends _IterableMatcher { 16 class _EveryElement extends _IterableMatcher {
17 final Matcher _matcher; 17 final Matcher _matcher;
18 18
19 _EveryElement(Matcher this._matcher); 19 _EveryElement(Matcher this._matcher);
20 20
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } else { 256 } else {
257 return mismatchDescription. 257 return mismatchDescription.
258 add('has '). 258 add('has ').
259 addDescriptionOf(matchState["actual"]). 259 addDescriptionOf(matchState["actual"]).
260 add(' which is not $_description '). 260 add(' which is not $_description ').
261 addDescriptionOf(matchState["expected"]). 261 addDescriptionOf(matchState["expected"]).
262 add(' at index ${matchState["index"]}'); 262 add(' at index ${matchState["index"]}');
263 } 263 }
264 } 264 }
265 } 265 }
OLDNEW
« no previous file with comments | « pkg/matcher/lib/src/interfaces.dart ('k') | pkg/matcher/lib/src/map_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698