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

Unified Diff: tests/language/list_test.dart

Issue 536043002: Merge array allocation and List._copyFromObjectArray to provide fast path for large arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « runtime/vm/object.cc ('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 d3afdf8be822999746a285f82d56e606a396466c..5a74e4fb6771d3928db421d45a2c195026a39493 100644
--- a/tests/language/list_test.dart
+++ b/tests/language/list_test.dart
@@ -5,6 +5,9 @@
import "package:expect/expect.dart";
+class A { }
+class B { }
+
class ListTest {
static void TestIterator() {
List<int> a = new List<int>(10);
@@ -42,6 +45,16 @@ class ListTest {
Expect.equals(sum, sum2);
}
+ static void testSublistTypeArguments() {
+ final list1 = new List<A>(0).sublist(0);
+ Expect.isTrue(list1 is List<A>);
+ Expect.isTrue(list1 is! List<B>);
+
+ final list2 = new List<A>(0).toList(growable: false);
+ Expect.isTrue(list2 is List<A>);
+ Expect.isTrue(list2 is! List<B>);
+ }
+
static void testMain() {
int len = 10;
List a = new List(len);
@@ -115,4 +128,5 @@ class ListTest {
main() {
ListTest.testMain();
+ ListTest.testSublistTypeArguments();
}
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698