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

Unified Diff: tests/corelib/growable_object_array2_vm_test.dart

Issue 10990083: Reapply change to hide VM-only List implementation classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dart:io perf regression. Created 8 years, 3 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 | « tests/corelib/corelib.status ('k') | tests/corelib/growable_object_array_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/growable_object_array2_vm_test.dart
diff --git a/tests/corelib/growable_object_array2_vm_test.dart b/tests/corelib/growable_object_array2_vm_test.dart
deleted file mode 100644
index 87abe709b9de55307861d50e9033da58624c1e37..0000000000000000000000000000000000000000
--- a/tests/corelib/growable_object_array2_vm_test.dart
+++ /dev/null
@@ -1,74 +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.
-// Test GrowableArray.dart.
-
-#library("GrowableObjectArray2Test.dart");
-#import("dart:coreimpl");
-
-class GrowableObjectArray2Test {
- static testMain() {
- var g = new GrowableObjectArray();
- Expect.equals(true, g is List);
- Expect.equals(true, g is GrowableObjectArray);
- Expect.equals(true, g.isEmpty());
- for (int i = 0; i < 100; i++) {
- g.add(1);
- }
- g.add(1001);
- Expect.equals(101, g.length);
- Expect.equals(1001, g[100]);
- Expect.equals(false, g.isEmpty());
- Expect.equals(1001, g.last());
- Expect.equals(1001, g.removeLast());
- Expect.equals(100, g.length);
-
- var f = new GrowableObjectArray();
- var list = new List(20);
- for (int i = 0; i < list.length; i++) {
- f.add(2);
- list[i] = 5;
- }
- list.setRange(0, f.length, f, 0);
- for (int i = 0; i < f.length; i++) {
- Expect.equals(2, list[i]);
- }
- f.setRange(0, 2, g, 10);
- Expect.equals(20, f.length);
-
- bool exceptionCaught = false;
- try {
- var elem = g[g.length];
- } on IndexOutOfRangeException catch (e) {
- exceptionCaught = true;
- }
- Expect.equals(true, exceptionCaught);
-
- List<int> plainArray = [4, 3, 9, 12, -4, 9];
- GrowableObjectArray h = new GrowableObjectArray.withCapacity(4);
- plainArray.forEach((elem) { h.add(elem); });
- int compare(a, b) {
- if (a < b) return -1;
- if (a > b) return 1;
- return 0;
- }
- h.sort(compare);
- Expect.equals(6, h.length);
- Expect.equals(-4, h[0]);
- Expect.equals(12, h[h.length - 1]);
- Set<int> t = new Set<int>.from(h);
- Expect.equals(true, t.contains(9));
- Expect.equals(true, t.contains(-4));
- Expect.equals(false, t.contains(-3));
- Expect.equals(5, t.length);
-
- h.clear();
- List array = const [0, 1, 2, 3, 4];
- h.addAll(array);
- Expect.equals(5, h.length);
- }
-}
-
-main() {
- GrowableObjectArray2Test.testMain();
-}
« no previous file with comments | « tests/corelib/corelib.status ('k') | tests/corelib/growable_object_array_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698