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

Unified Diff: pkg/unittest/test/matchers_test.dart

Issue 14022007: Move Iterable implementation to collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
Index: pkg/unittest/test/matchers_test.dart
diff --git a/pkg/unittest/test/matchers_test.dart b/pkg/unittest/test/matchers_test.dart
index f49e0cb553fdfaf9ff347fee1db39485df42e2ff..2410069898e5bae9a8383428aeffd509951f118d 100644
--- a/pkg/unittest/test/matchers_test.dart
+++ b/pkg/unittest/test/matchers_test.dart
@@ -35,19 +35,19 @@ class HasPrice extends CustomMatcher {
featureValueOf(actual) => actual.price;
}
-class SimpleIterable extends Iterable {
+class SimpleIterable extends IterableBase {
int count;
SimpleIterable(this.count);
-
+
bool contains(int val) => count < val ? false : true;
-
+
bool any(bool f(element)) {
for(var i = 0; i <= count; i++) {
if(f(i)) return true;
}
return false;
}
-
+
String toString() => "<[$count]>";
Iterator get iterator {
@@ -197,7 +197,7 @@ void main() {
"but: exception <Exception> does not match "
"UnsupportedError.");
});
-
+
test('throwsStateError', () {
shouldPass(() { throw new StateError(''); },
throwsStateError);
@@ -453,14 +453,14 @@ void main() {
shouldPass(d, isEmpty);
shouldFail(e, isEmpty, "Expected: empty but: was <[1]>.");
});
-
+
test('contains', () {
var d = new SimpleIterable(3);
shouldPass(d, contains(2));
shouldFail(d, contains(5), "Expected: contains <5> but: was <[3]>.");
});
});
-
+
group('Collection Matchers', () {
test('isEmpty', () {

Powered by Google App Engine
This is Rietveld 408576698