| 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"; |
| 6 |
| 5 class ListIteratorsTest { | 7 class ListIteratorsTest { |
| 6 static void checkListIterator(List a) { | 8 static void checkListIterator(List a) { |
| 7 Iterator it = a.iterator; | 9 Iterator it = a.iterator; |
| 8 Expect.isNull(it.current); | 10 Expect.isNull(it.current); |
| 9 for (int i = 0; i < a.length; i++) { | 11 for (int i = 0; i < a.length; i++) { |
| 10 Expect.isTrue(it.moveNext()); | 12 Expect.isTrue(it.moveNext()); |
| 11 var elem = it.current; | 13 var elem = it.current; |
| 12 Expect.equals(a[i], elem); | 14 Expect.equals(a[i], elem); |
| 13 } | 15 } |
| 14 Expect.isFalse(it.moveNext()); | 16 Expect.isFalse(it.moveNext()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 39 Expect.equals(3, it.current); | 41 Expect.equals(3, it.current); |
| 40 Expect.throws(it.moveNext, (e) => e is ConcurrentModificationError); | 42 Expect.throws(it.moveNext, (e) => e is ConcurrentModificationError); |
| 41 // No progress when throwing. | 43 // No progress when throwing. |
| 42 Expect.equals(3, it.current); | 44 Expect.equals(3, it.current); |
| 43 } | 45 } |
| 44 } | 46 } |
| 45 | 47 |
| 46 main() { | 48 main() { |
| 47 ListIteratorsTest.testMain(); | 49 ListIteratorsTest.testMain(); |
| 48 } | 50 } |
| OLD | NEW |