OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 main() { |
| 6 var it = new HasNextIterator([].iterator); |
| 7 Expect.isFalse(it.hasNext); |
| 8 Expect.isFalse(it.hasNext); |
| 9 Expect.throws(() => it.next(), (e) => e is StateError); |
| 10 Expect.isFalse(it.hasNext); |
| 11 |
| 12 it = new HasNextIterator([1].iterator); |
| 13 Expect.isTrue(it.hasNext); |
| 14 Expect.isTrue(it.hasNext); |
| 15 Expect.equals(1, it.next()); |
| 16 Expect.isFalse(it.hasNext); |
| 17 Expect.isFalse(it.hasNext); |
| 18 Expect.throws(() => it.next(), (e) => e is StateError); |
| 19 Expect.isFalse(it.hasNext); |
| 20 |
| 21 it = new HasNextIterator([1, 2].iterator); |
| 22 Expect.isTrue(it.hasNext); |
| 23 Expect.isTrue(it.hasNext); |
| 24 Expect.equals(1, it.next()); |
| 25 Expect.isTrue(it.hasNext); |
| 26 Expect.isTrue(it.hasNext); |
| 27 Expect.equals(2, it.next()); |
| 28 Expect.isFalse(it.hasNext); |
| 29 Expect.isFalse(it.hasNext); |
| 30 Expect.throws(() => it.next(), (e) => e is StateError); |
| 31 Expect.isFalse(it.hasNext); |
| 32 } |
OLD | NEW |