| 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>.fixedLength(10); | 10 List<int> a = new List<int>.fixedLength(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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // We cannot write just 'list.removeLast' due to issue 3769. | 104 // We cannot write just 'list.removeLast' due to issue 3769. |
| 103 Expect.throws(() => list.removeLast(), | 105 Expect.throws(() => list.removeLast(), |
| 104 (e) => e is RangeError); | 106 (e) => e is RangeError); |
| 105 Expect.equals(0, list.length); | 107 Expect.equals(0, list.length); |
| 106 } | 108 } |
| 107 } | 109 } |
| 108 | 110 |
| 109 main() { | 111 main() { |
| 110 ListTest.testMain(); | 112 ListTest.testMain(); |
| 111 } | 113 } |
| OLD | NEW |