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

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

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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) 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:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
9 9
10 main() { 10 main() {
11 // 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
12 // 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
13 // method. 13 // method.
14 asyncTest(() => compile( 14 asyncTest(() => compile(
15 'final List a = const ["bar", "baz"];' 15 'final List a = const ["bar", "baz"];'
16 'int foo() {' 16 'int foo() {'
17 ' for (int i = 0; i < a.length; i++) {' 17 ' for (int i = 0; i < a.length; i++) {'
18 ' print(a[i]);' 18 ' print(a[i]);'
19 ' }' 19 ' }'
20 '}', 20 '}',
21 entry: 'foo', minify: false).then((String generated) { 21 entry: 'foo',
22 RegExp re = new RegExp(r"var "); 22 minify: false).then((String generated) {
23 Expect.isTrue(re.hasMatch(generated)); 23 RegExp re = new RegExp(r"var ");
24 print(generated); 24 Expect.isTrue(re.hasMatch(generated));
25 Expect.equals(1, re.allMatches(generated).length); 25 print(generated);
26 })); 26 Expect.equals(1, re.allMatches(generated).length);
27 }));
27 } 28 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/dead_phi_eliminator_test.dart ('k') | tests/compiler/dart2js/deferred_custom_element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698