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

Unified Diff: tests/language/list_test.dart

Issue 11312122: Change List constructors. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Address comments and fix. Created 8 years, 1 month 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
« sdk/lib/core/list.dart ('K') | « tests/corelib/list_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/list_test.dart
diff --git a/tests/language/list_test.dart b/tests/language/list_test.dart
index 899c1783920b059f0030a50e8311accbef57f9dc..30be6b9bbbd94838425d29678a9f32b5264c9adc 100644
--- a/tests/language/list_test.dart
+++ b/tests/language/list_test.dart
@@ -5,7 +5,7 @@
class ListTest {
static void TestIterator() {
- List<int> a = new List<int>(10);
+ List<int> a = new List<int>.fixedLength(10);
int count = 0;
// Basic iteration over ObjectList.
@@ -42,7 +42,7 @@ class ListTest {
static void testMain() {
int len = 10;
- List a = new List(len);
+ List a = new List.fixedLength(len);
Expect.equals(true, a is List);
Expect.equals(len, a.length);
a.forEach(f(element) { Expect.equals(null, element); });
@@ -51,17 +51,17 @@ class ListTest {
Expect.throws(() => a[len], (e) => e is RangeError);
Expect.throws(() {
- List a = new List(4);
+ List a = new List.fixedLength(4);
a.setRange(1, 1, a, null);
}, (e) => true);
Expect.throws(() {
- List a = new List(4);
+ List a = new List.fixedLength(4);
a.setRange(10, 1, a, 1);
}, (e) => e is RangeError);
- a = new List(4);
- List b = new List(4);
+ a = new List.fixedLength(4);
+ List b = new List.fixedLength(4);
b.setRange(0, 4, a, 0);
List<int> unsorted = [4, 3, 9, 12, -4, 9];
@@ -95,8 +95,9 @@ class ListTest {
Expect.throws(() => unsorted[2.1],
(e) => e is ArgumentError || e is TypeError);
- Expect.throws(() => new List(-1), (e) => true);
- Expect.throws(() => new List(99999999999999999999999), (e) => true);
+ Expect.throws(() => new List.fixedLength(-1), (e) => true);
Lasse Reichstein Nielsen 2012/11/12 11:31:06 Can't you just omit the exception-test method in t
floitsch 2012/11/12 13:21:50 Done.
+ Expect.throws(() => new List.fixedLength(99999999999999999999999),
+ (e) => true);
List list = new List();
// We cannot write just 'list.removeLast' due to issue 3769.
« sdk/lib/core/list.dart ('K') | « tests/corelib/list_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698