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