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

Side by Side Diff: tests/compiler/dart2js/declare_once_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 // Test that parameters keep their names in the output. 4 // Test that parameters keep their names in the output.
5 5
6 import "package:expect/expect.dart"; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:expect/expect.dart';
7 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
8 9
9 main() { 10 main() {
10 // For a function with only one variable we declare it inline for more 11 // For a function with only one variable we declare it inline for more
11 // compactness. Test that we don't also declare it at the start of the 12 // compactness. Test that we don't also declare it at the start of the
12 // method. 13 // method.
13 var generated = compile( 14 asyncTest(() => compile(
14 'final List a = const ["bar", "baz"];' 15 'final List a = const ["bar", "baz"];'
15 'int foo() {' 16 'int foo() {'
16 ' for (int i = 0; i < a.length; i++) {' 17 ' for (int i = 0; i < a.length; i++) {'
17 ' print(a[i]);' 18 ' print(a[i]);'
18 ' }' 19 ' }'
19 '}', 20 '}',
20 entry: 'foo', minify: false); 21 entry: 'foo', minify: false).then((String generated) {
21 RegExp re = new RegExp(r"var "); 22 RegExp re = new RegExp(r"var ");
22 Expect.isTrue(re.hasMatch(generated)); 23 Expect.isTrue(re.hasMatch(generated));
23 print(generated); 24 print(generated);
24 Expect.equals(1, re.allMatches(generated).length); 25 Expect.equals(1, re.allMatches(generated).length);
26 }));
25 } 27 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/dead_phi_eliminator_test.dart ('k') | tests/compiler/dart2js/find_my_name_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698