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/compiler/dart2js/top_level_closure_tree_shake_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 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'package:expect/expect.dart'; 6 import 'package:expect/expect.dart';
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
9 9
10 const String TEST_ONE = r""" 10 const String TEST_ONE = r"""
11 main() { 11 main() {
12 var f = use; 12 var f = use;
13 if (false) { 13 if (false) {
14 // This statement and the use of 'foo' should be optimized away, causing 14 // This statement and the use of 'foo' should be optimized away, causing
15 // 'foo' to be absent from the final code. 15 // 'foo' to be absent from the final code.
16 f(foo); 16 f(foo);
17 } 17 }
18 f(bar); 18 f(bar);
19 } 19 }
20 20
21 foo() => 'Tarantula!'; 21 foo() => 'Tarantula!';
22 bar() => 'Coelacanth!'; 22 bar() => 'Coelacanth!';
23 23
24 use(x) { 24 use(x) {
25 print(x()); 25 print(x());
26 } 26 }
27 """; 27 """;
28 28
29
30 main() { 29 main() {
31 asyncTest(() => Future.wait([ 30 asyncTest(() => Future.wait([
32 compileAll(TEST_ONE).then((String generated) { 31 compileAll(TEST_ONE).then((String generated) {
33 Expect.isFalse(generated.contains('Tarantula!'), 32 Expect.isFalse(
34 "failed to remove 'foo'"); 33 generated.contains('Tarantula!'), "failed to remove 'foo'");
35 Expect.isTrue(generated.contains('Coelacanth!')); 34 Expect.isTrue(generated.contains('Coelacanth!'));
36 }), 35 }),
37 ])); 36 ]));
38 } 37 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/token_naming_test.dart ('k') | tests/compiler/dart2js/tree_shaking_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698