OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 class ConstListTest { | 7 class ConstListTest { |
8 | |
9 static testConstructors() { | 8 static testConstructors() { |
10 List fixedList = new List(4); | 9 List fixedList = new List(4); |
11 List fixedList2 = new List(4); | 10 List fixedList2 = new List(4); |
12 List growableList = new List(); | 11 List growableList = new List(); |
13 List growableList2 = new List(); | 12 List growableList2 = new List(); |
14 for (int i = 0; i < 4; i++) { | 13 for (int i = 0; i < 4; i++) { |
15 fixedList[i] = i; | 14 fixedList[i] = i; |
16 fixedList2[i] = i; | 15 fixedList2[i] = i; |
17 growableList.add(i); | 16 growableList.add(i); |
18 growableList2.add(i); | 17 growableList2.add(i); |
(...skipping 24 matching lines...) Expand all Loading... |
43 a = const <dynamic>[1, 2, 3.1]; | 42 a = const <dynamic>[1, 2, 3.1]; |
44 b = const [1, 2, 3.1]; | 43 b = const [1, 2, 3.1]; |
45 Expect.equals(true, a == b); | 44 Expect.equals(true, a == b); |
46 } | 45 } |
47 } | 46 } |
48 | 47 |
49 main() { | 48 main() { |
50 ConstListTest.testConstructors(); | 49 ConstListTest.testConstructors(); |
51 ConstListTest.testLiterals(); | 50 ConstListTest.testLiterals(); |
52 } | 51 } |
OLD | NEW |