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

Side by Side Diff: tests/compiler/dart2js/for_in_test.dart

Issue 326913002: Make dart2js unittests async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 6 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 'dart:async';
6 import 'package:expect/expect.dart';
7 import 'package:async_helper/async_helper.dart';
6 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
7 9
8 const String TEST_ONE = r""" 10 const String TEST_ONE = r"""
9 foo(a) { 11 foo(a) {
10 int x = 0; 12 int x = 0;
11 for (int i in a) { 13 for (int i in a) {
12 x += i; 14 x += i;
13 } 15 }
14 return x; 16 return x;
15 } 17 }
16 """; 18 """;
17 19
18 const String TEST_TWO = r""" 20 const String TEST_TWO = r"""
19 foo(a) { 21 foo(a) {
20 int x = 0; 22 int x = 0;
21 for (int i in a) { 23 for (int i in a) {
22 if (i == 5) continue; 24 if (i == 5) continue;
23 x += i; 25 x += i;
24 } 26 }
25 return x; 27 return x;
26 } 28 }
27 """; 29 """;
28 30
29 main() { 31 main() {
30 String generated = compile(TEST_ONE, entry: 'foo'); 32 asyncTest(() => Future.wait([
31 Expect.isTrue(!generated.contains(r'break')); 33 compile(TEST_ONE, entry: 'foo', check: (String generated) {
32 generated = compile(TEST_TWO, entry: 'foo'); 34 Expect.isTrue(!generated.contains(r'break'));
33 Expect.isTrue(generated.contains(r'continue')); 35 }),
36 compile(TEST_TWO, entry: 'foo', check: (String generated) {
37 Expect.isTrue(generated.contains(r'continue'));
38 }),
39 ]));
34 } 40 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/find_my_name_test.dart ('k') | tests/compiler/dart2js/generate_at_use_site_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698