Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: tests/language/sync_generator1_test.dart

Issue 911763003: Revert "Fix warning in sync_generator1_test.dart" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/language_analyzer2.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Simple test program for sync* generator functions. 5 // Simple test program for sync* generator functions.
6 6
7 // VMOptions=--optimization_counter_threshold=10 7 // VMOptions=--optimization_counter_threshold=10
8 8
9 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 einsZwei() sync* { 37 einsZwei() sync* {
38 yield 1; 38 yield 1;
39 yield* [2, 3]; 39 yield* [2, 3];
40 yield* []; 40 yield* [];
41 yield 5; 41 yield 5;
42 yield [6]; 42 yield [6];
43 } 43 }
44 44
45 dreiVier() sync* { 45 dreiVier() sync* {
46 // Throws type error: yielded object is not an iterable. 46 yield* 3; // Throws type error: yielded object is not an iterable.
47 yield* 3; /// 01: static type warning
48 } 47 }
49 48
50 main() { 49 main() {
51 for (int i = 0; i < 10; i++) { 50 for (int i = 0; i < 10; i++) {
52 var sums = sum10(); 51 var sums = sum10();
53 print(sums); 52 print(sums);
54 Expect.isTrue(sums is Iterable); 53 Expect.isTrue(sums is Iterable);
55 Expect.equals(10, sums.length); 54 Expect.equals(10, sums.length);
56 Expect.equals(1, sums.first); 55 Expect.equals(1, sums.first);
57 Expect.equals(55, sums.last); 56 Expect.equals(55, sums.last);
(...skipping 15 matching lines...) Expand all
73 Expect.isTrue(i.moveNext()); 72 Expect.isTrue(i.moveNext());
74 Expect.equals(e, i.current); 73 Expect.equals(e, i.current);
75 }); 74 });
76 75
77 print(sync); 76 print(sync);
78 Expect.equals("sync", sync.single); 77 Expect.equals("sync", sync.single);
79 78
80 print(einsZwei()); 79 print(einsZwei());
81 Expect.equals("(1, 2, 3, 5, [6])", einsZwei().toString()); 80 Expect.equals("(1, 2, 3, 5, [6])", einsZwei().toString());
82 81
83 Expect.throws(() => dreiVier().toString()); /// 01: continued 82 Expect.throws(() => dreiVier().toString());
84 } 83 }
85 } 84 }
OLDNEW
« no previous file with comments | « tests/language/language_analyzer2.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698