OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 Iterable<int> foo1() sync* { | 7 Iterable<int> foo1() sync* { |
8 yield 1; | 8 yield 1; |
9 } | 9 } |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 p++; | 33 p++; |
34 yield p + i; | 34 yield p + i; |
35 } | 35 } |
36 | 36 |
37 main() { | 37 main() { |
38 Expect.listEquals([1], foo1().toList()); | 38 Expect.listEquals([1], foo1().toList()); |
39 Expect.listEquals([null, -1, 0, 1, 2, 3, 0, 1, 2, 3], | 39 Expect.listEquals([null, -1, 0, 1, 2, 3, 0, 1, 2, 3], |
40 foo2(4).take(10).toList()); | 40 foo2(4).take(10).toList()); |
41 Iterable t = foo3(0); | 41 Iterable t = foo3(0); |
42 Iterator it1 = t.iterator; | 42 Iterator it1 = t.iterator; |
43 Iterator it2 = t.iterator; /// copyParameters: ok | 43 Iterator it2 = t.iterator; //# copyParameters: ok |
44 it1.moveNext(); | 44 it1.moveNext(); |
45 it2.moveNext(); /// copyParameters: continued | 45 it2.moveNext(); //# copyParameters: continued |
46 Expect.equals(2, it1.current); | 46 Expect.equals(2, it1.current); |
47 // TODO(sigurdm): Check up on the spec here. | 47 // TODO(sigurdm): Check up on the spec here. |
48 Expect.equals(2, it2.current); // /// copyParameters: continued | 48 Expect.equals(2, it2.current); // //# copyParameters: continued |
49 Expect.isFalse(it1.moveNext()); | 49 Expect.isFalse(it1.moveNext()); |
50 // Test that two `moveNext()` calls are fine. | 50 // Test that two `moveNext()` calls are fine. |
51 Expect.isFalse(it1.moveNext()); | 51 Expect.isFalse(it1.moveNext()); |
52 Expect.isFalse(it2.moveNext()); /// copyParameters: continued | 52 Expect.isFalse(it2.moveNext()); //# copyParameters: continued |
53 Expect.isFalse(it2.moveNext()); /// copyParameters: continued | 53 Expect.isFalse(it2.moveNext()); //# copyParameters: continued |
54 } | 54 } |
OLD | NEW |