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/test_common.dart

Issue 15492003: Split out unittest tests whose behavior differs in minified mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 7 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/unittest/test/pretty_print_unminified_test.dart ('k') | pkg/unittest/test/test_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/test_common.dart
diff --git a/pkg/unittest/test/test_common.dart b/pkg/unittest/test/test_common.dart
new file mode 100644
index 0000000000000000000000000000000000000000..863176883e87b301ea653117b234eb751ee9354a
--- /dev/null
+++ b/pkg/unittest/test/test_common.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test_common;
+
+import 'dart:collection';
+
+import 'package:unittest/unittest.dart';
+
+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 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 _count;
+ int _current;
+
+ SimpleIterator(this._count);
+
+ bool moveNext() {
+ if (_count > 0) {
+ _current = _count;
+ _count--;
+ return true;
+ }
+ _current = null;
+ return false;
+ }
+
+ get current => _current;
+}
+
« no previous file with comments | « pkg/unittest/test/pretty_print_unminified_test.dart ('k') | pkg/unittest/test/test_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698