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

Unified Diff: pkg/unittest/lib/src/iterable_matchers.dart

Issue 20172003: Replace someElement with anyElement. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/unittest/test/matchers_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/iterable_matchers.dart
===================================================================
--- pkg/unittest/lib/src/iterable_matchers.dart (revision 25450)
+++ pkg/unittest/lib/src/iterable_matchers.dart (working copy)
@@ -58,15 +58,21 @@
}
/**
+ * Deprecated form of [anyElement].
+ */
+@deprecated
+Matcher someElement(matcher) => new _AnyElement(wrapMatcher(matcher));
+
+/**
* Returns a matcher which matches [Iterable]s in which at least one
* element matches the given [matcher].
*/
-Matcher someElement(matcher) => new _SomeElement(wrapMatcher(matcher));
+Matcher anyElement(matcher) => new _AnyElement(wrapMatcher(matcher));
-class _SomeElement extends _IterableMatcher {
+class _AnyElement extends _IterableMatcher {
Matcher _matcher;
- _SomeElement(this._matcher);
+ _AnyElement(this._matcher);
bool matches(item, Map matchState) {
return item.any((e) => _matcher.matches(e, matchState));
Sean Eagan 2013/07/25 16:55:15 In describe below, 'some element ' -> 'any element
gram 2013/07/25 17:07:05 I thought about that but IMO 'some element' reads
« no previous file with comments | « no previous file | pkg/unittest/test/matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698