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

Unified Diff: test/test_utils.dart

Issue 935923002: Re-add minified/unminified tests. (Closed) Base URL: git@github.com:dart-lang/matcher@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: test/test_utils.dart
diff --git a/test/test_utils.dart b/test/test_utils.dart
index fb342a49a79477deb0a983b02428c58d646d4ecc..ed3e1c1ebee047e6119f92e9105f4dcb81933afe 100644
--- a/test/test_utils.dart
+++ b/test/test_utils.dart
@@ -33,3 +33,52 @@ doesNotThrow() {}
doesThrow() {
throw 'X';
}
+
+class Widget {
+ int price;
+}
+
+class HasPrice extends CustomMatcher {
+ HasPrice(matcher) : super("Widget with a price that is", "price", matcher);
+ featureValueOf(actual) => actual.price;
+}
+
+class SimpleIterable extends IterableBase<int> {
+ final 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 {
+ return new _SimpleIterator(count);
+ }
+}
+
+class _SimpleIterator implements Iterator<int> {
+ int _count;
+ int _current;
+
+ _SimpleIterator(this._count);
+
+ bool moveNext() {
+ if (_count > 0) {
+ _current = _count;
+ _count--;
+ return true;
+ }
+ _current = null;
+ return false;
+ }
+
+ int get current => _current;
+}

Powered by Google App Engine
This is Rietveld 408576698