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

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: Address comments. Merge to head. 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
« no previous file with comments | « pkg/serialization/lib/src/serialization_rule.dart ('k') | runtime/lib/collection_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/matchers_test.dart
diff --git a/pkg/unittest/test/matchers_test.dart b/pkg/unittest/test/matchers_test.dart
index 7e97b38dd0cf607711324a44d4c48bc56eecfe97..be286ea3cc2b50eb7f168a0e70014497b5697296 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('Iterable Matchers', () {
test('isEmpty', () {
« no previous file with comments | « pkg/serialization/lib/src/serialization_rule.dart ('k') | runtime/lib/collection_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698