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 // Dart test program for testing arrays. | 4 // Dart test program for testing arrays. |
5 | 5 |
6 import "package:expect/expect.dart"; | |
7 | |
8 class ListTest { | 6 class ListTest { |
9 static void TestIterator() { | 7 static void TestIterator() { |
10 List<int> a = new List<int>(10); | 8 List<int> a = new List<int>(10); |
11 int count = 0; | 9 int count = 0; |
12 | 10 |
13 // Basic iteration over ObjectList. | 11 // Basic iteration over ObjectList. |
14 for (int elem in a) { | 12 for (int elem in a) { |
15 Expect.equals(null, elem); | 13 Expect.equals(null, elem); |
16 count++; | 14 count++; |
17 } | 15 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // We cannot write just 'list.removeLast' due to issue 3769. | 107 // We cannot write just 'list.removeLast' due to issue 3769. |
110 Expect.throws(() => list.removeLast(), | 108 Expect.throws(() => list.removeLast(), |
111 (e) => e is RangeError); | 109 (e) => e is RangeError); |
112 Expect.equals(0, list.length); | 110 Expect.equals(0, list.length); |
113 } | 111 } |
114 } | 112 } |
115 | 113 |
116 main() { | 114 main() { |
117 ListTest.testMain(); | 115 ListTest.testMain(); |
118 } | 116 } |
OLD | NEW |