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

Side by Side Diff: tests/compiler/dart2js/pretty_parameter_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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 'dart:async'; 6 import 'dart:async';
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'compiler_helper.dart'; 9 import 'compiler_helper.dart';
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (test) { 67 if (test) {
68 foo(1, 2); 68 foo(1, 2);
69 result = 42; 69 result = 42;
70 } 70 }
71 print(result); 71 print(result);
72 } 72 }
73 """; 73 """;
74 74
75 main() { 75 main() {
76 asyncTest(() => Future.wait([ 76 asyncTest(() => Future.wait([
77 compile(FOO, entry: 'foo', check: (String generated) { 77 compile(FOO, entry: 'foo', check: (String generated) {
78 Expect.isTrue(generated.contains(r"function(a, b) {")); 78 Expect.isTrue(generated.contains(r"function(a, b) {"));
79 }), 79 }),
80 80 compile(BAR, entry: 'bar', check: (String generated) {
81 compile(BAR, entry: 'bar', check: (String generated) { 81 Expect.isTrue(generated.contains(r"function($eval, $$eval) {"));
82 Expect.isTrue(generated.contains(r"function($eval, $$eval) {")); 82 }),
83 }), 83 compile(PARAMETER_AND_TEMP, entry: 'bar', check: (String generated) {
84 84 Expect.isTrue(generated.contains(r"print(t00)"));
85 compile(PARAMETER_AND_TEMP, entry: 'bar', check: (String generated) { 85 // Check that the second 't0' got another name.
86 Expect.isTrue(generated.contains(r"print(t00)")); 86 Expect.isTrue(generated.contains(r"print(t01)"));
87 // Check that the second 't0' got another name. 87 }),
88 Expect.isTrue(generated.contains(r"print(t01)")); 88 compile(MULTIPLE_PHIS_ONE_LOCAL, entry: 'foo',
89 }), 89 check: (String generated) {
90 90 Expect.isTrue(generated.contains("var a;"));
91 compile(MULTIPLE_PHIS_ONE_LOCAL, entry: 'foo', check: (String generated) { 91 // Check that there is only one var declaration.
92 Expect.isTrue(generated.contains("var a;")); 92 checkNumberOfMatches(
93 // Check that there is only one var declaration. 93 new RegExp("var").allMatches(generated).iterator, 1);
94 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); 94 }),
95 }), 95 compile(NO_LOCAL, entry: 'foo', check: (String generated) {
96 96 Expect.isFalse(generated.contains('var'));
97 compile(NO_LOCAL, entry: 'foo', check: (String generated) { 97 }),
98 Expect.isFalse(generated.contains('var')); 98 compile(PARAMETER_INIT, entry: 'foo', check: (String generated) {
99 }), 99 // Check that there is only one var declaration.
100 100 checkNumberOfMatches(
101 compile(PARAMETER_INIT, entry: 'foo', check: (String generated) { 101 new RegExp("var").allMatches(generated).iterator, 1);
102 // Check that there is only one var declaration. 102 }),
103 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); 103 ]));
104 }),
105 ]));
106 } 104 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/preserve_uris_test.dart ('k') | tests/compiler/dart2js/private_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698