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

Side by Side Diff: test/codegen/syncstar_syntax.dart

Issue 1243503007: fixes #221, initial sync*, async, async* implementation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 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
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 import 'package:expect/expect.dart';
6
5 Iterable<int> foo() sync* { 7 Iterable<int> foo() sync* {
6 yield 1; 8 yield 1;
7 yield* [2, 3]; 9 yield* [2, 3];
8 } 10 }
9 11
10 class Class { 12 class Class {
11 Iterable<int> bar() sync* { 13 Iterable<int> bar() sync* {
12 yield 1; 14 yield 1;
13 yield* [2, 3]; 15 yield* [2, 3];
14 } 16 }
15 17
16 static Iterable<int> baz() sync* { 18 static Iterable<int> baz() sync* {
17 yield 1; 19 yield 1;
18 yield* [2, 3]; 20 yield* [2, 3];
19 } 21 }
20 } 22 }
21 23
22 main() { 24 main() {
23 Iterable<int> qux() sync* { 25 Iterable<int> qux() sync* {
24 yield 1; 26 yield 1;
25 yield* [2, 3]; 27 yield* [2, 3];
26 } 28 }
27 29
28 foo().forEach(print); 30 Expect.listEquals([1, 2, 3], foo().toList());
29 new Class().bar().forEach(print); 31 Expect.listEquals([1, 2, 3], new Class().bar().toList());
30 Class.baz().forEach(print); 32 Expect.listEquals([1, 2, 3], Class.baz().toList());
31 qux().forEach(print); 33 Expect.listEquals([1, 2, 3], qux().toList());
32 } 34 }
OLDNEW
« no previous file with comments | « test/codegen/language/syncstar_yieldstar_test.dart ('k') | test/codegen/syncstar_yield_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698