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

Unified Diff: tests/corelib/src/ListFromListTest.dart

Issue 8422005: Remove List.fromList constructor, and List.copyFrom. They are duplicates of the new range methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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
« runtime/lib/array.dart ('K') | « tests/co19/co19-runtime.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/src/ListFromListTest.dart
===================================================================
--- tests/corelib/src/ListFromListTest.dart (revision 938)
+++ tests/corelib/src/ListFromListTest.dart (working copy)
@@ -1,87 +0,0 @@
-// Copyright (c) 2011, 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.
-
-class ListFromListTest {
-
- static testMain() {
- var list = [1, 2, 4];
-
- var sub = new List.fromList(list, 0, 3);
- Expect.equals(3, sub.length);
- Expect.equals(1, sub[0]);
- Expect.equals(2, sub[1]);
- Expect.equals(4, sub[2]);
-
- sub = new List.fromList(list, 1, 3);
- Expect.equals(2, sub.length);
- Expect.equals(2, sub[0]);
- Expect.equals(4, sub[1]);
-
- sub = new List.fromList(list, 2, 3);
- Expect.equals(1, sub.length);
- Expect.equals(4, sub[0]);
-
- sub = new List.fromList(list, 0, 0);
- Expect.equals(0, sub.length);
-
- sub = new List.fromList(list, 3, 3);
- Expect.equals(0, sub.length);
-
- sub = new List.fromList(list, 0, 1);
- Expect.equals(1, sub.length);
- Expect.equals(1, sub[0]);
-
- sub = new List.fromList(list, 0, 2);
- Expect.equals(2, sub.length);
- Expect.equals(1, sub[0]);
- Expect.equals(2, sub[1]);
-
- sub = new List.fromList(list, 1, 2);
- Expect.equals(1, sub.length);
- Expect.equals(2, sub[0]);
-
- sub = new List.fromList(list, -1, 2);
- Expect.equals(2, sub.length);
- Expect.equals(1, sub[0]);
- Expect.equals(2, sub[1]);
-
- sub = new List.fromList(list, 1, 5);
- Expect.equals(2, sub.length);
- Expect.equals(2, sub[0]);
- Expect.equals(4, sub[1]);
-
- list = [];
- sub = new List.fromList(list, 1, 5);
- Expect.equals(0, sub.length);
-
- sub = new List.fromList(list, 0, 0);
- Expect.equals(0, sub.length);
-
- sub = new List.fromList(list, 0, 1);
- Expect.equals(0, sub.length);
-
- // Test that the original list is unchanged after modifications
- // to the list.
- list = [1, 2, 4];
- sub = new List.fromList(list, 0, 3);
- sub[0] = 42;
- Expect.equals(1, list[0]);
- Expect.equals(42, sub[0]);
-
- sub.add(42);
- Expect.equals(4, sub.length);
- Expect.equals(3, list.length);
-
- list.add(43);
- Expect.equals(4, sub.length);
- Expect.equals(4, list.length);
-
- Expect.equals(42, sub[3]);
- Expect.equals(43, list[3]);
- }
-}
-
-main() {
- ListFromListTest.testMain();
-}
« runtime/lib/array.dart ('K') | « tests/co19/co19-runtime.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698