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

Unified Diff: tests/corelib/growable_list_test.dart

Issue 515453002: Fix bugs in growble_list_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/growable_list_test.dart
diff --git a/tests/corelib/growable_list_test.dart b/tests/corelib/growable_list_test.dart
index 6f1b9a0e86a25c7c6c9aaedefd42a1a9ca0ecabf..98b4e1ff725350336f499d615986202b4d4200b0 100644
--- a/tests/corelib/growable_list_test.dart
+++ b/tests/corelib/growable_list_test.dart
@@ -9,7 +9,7 @@ import "dart:collection" show IterableBase;
// Iterable generating numbers in range [0..count).
// May perform callback at some point underways.
-class TestIterableBase<E> extends IterableBase<E> {
+class TestIterableBase extends IterableBase<int> {
final int length;
final int count;
// call [callback] if generating callbackIndex.
@@ -17,24 +17,25 @@ class TestIterableBase<E> extends IterableBase<E> {
final Function callback;
TestIterableBase(this.length, this.count,
this.callbackIndex, this.callback);
- Iterator<E> get iterator => new CallbackIterator(this);
+ Iterator<int> get iterator => new CallbackIterator(this);
}
-class TestIterable<E> extends TestIterableBase<E> {
+class TestIterable extends TestIterableBase {
TestIterable(count, [callbackIndex = -1, callback])
: super(-1, count, callbackIndex, callback);
int get length => throw "SHOULD NOT BE CALLED";
}
// Implement Set for private EfficientLength interface.
-@proxy // Avoid warnings because we don't actually implement Set.
-class EfficientTestIterable<E> extends TestIterableBase<E>
- implements Set<E> {
+class EfficientTestIterable extends TestIterableBase
+ implements Set<int> {
EfficientTestIterable(length, count, [callbackIndex = -1, callback])
: super(length, count, callbackIndex, callback);
+ // Avoid warnings because we don't actually implement Set.
+ noSuchMethod(i) => super.noSuchMethod(i);
}
-class CallbackIterator<E> implements Iterator<E> {
+class CallbackIterator implements Iterator<int> {
TestIterableBase _iterable;
int _current = null;
int _nextIndex = 0;
@@ -60,7 +61,7 @@ void main() {
{
// Change length of list after 20 additions.
var l = [];
- var ci = new TestIterable<E>(257, 200, () {
+ var ci = new TestIterable(257, 200, () {
l.add("X");
});
Expect.throws(() {
@@ -71,7 +72,7 @@ void main() {
{
// Change length of list after 20 additions.
var l = [];
- var ci = new TestIterable<E>(257, 200, () {
+ var ci = new TestIterable(257, 200, () {
l.length = 0;
});
Expect.throws(() {
@@ -83,7 +84,7 @@ void main() {
{
// Change length of list after 20 additions.
var l = [];
- var ci = new EfficientTestIterable<E>(257, 257, 20, () {
+ var ci = new EfficientTestIterable(257, 257, 20, () {
l.add("X");
});
Expect.throws(() {
@@ -93,7 +94,7 @@ void main() {
{
var l = [];
- var ci = new EfficientTestIterable<E>(257, 257, 20, () {
+ var ci = new EfficientTestIterable(257, 257, 20, () {
l.length = 0;
});
Expect.throws(() {
@@ -104,7 +105,7 @@ void main() {
{
// Length 50, only 25 elements.
var l = [];
- var ci = new EfficientTestIterable<E>(500, 250);
+ var ci = new EfficientTestIterable(500, 250);
l.addAll(ci);
Expect.listEquals(new List.generate(250, (x)=>x), l);
}
@@ -112,7 +113,7 @@ void main() {
{
// Length 25, but 50 elements.
var l = [];
- var ci = new EfficientTestIterable<E>(250, 500);
+ var ci = new EfficientTestIterable(250, 500);
l.addAll(ci);
Expect.listEquals(new List.generate(500, (x)=>x), l);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698