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

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

Issue 690103004: Move dart2js from sdk/lib/_internal/compiler to pkg/compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 'mock_compiler.dart'; 8 import 'mock_compiler.dart';
9 import 'package:compiler/implementation/js/js.dart' as jsAst; 9 import 'package:compiler/src/js/js.dart' as jsAst;
10 import 'package:compiler/implementation/js/js.dart' show js; 10 import 'package:compiler/src/js/js.dart' show js;
11 11
12 12
13 Future testStatement(String statement, List arguments, String expect) { 13 Future testStatement(String statement, List arguments, String expect) {
14 jsAst.Node node = js.statement(statement, arguments); 14 jsAst.Node node = js.statement(statement, arguments);
15 return MockCompiler.create((MockCompiler compiler) { 15 return MockCompiler.create((MockCompiler compiler) {
16 String jsText = 16 String jsText =
17 jsAst.prettyPrint(node, compiler, allowVariableMinification: false) 17 jsAst.prettyPrint(node, compiler, allowVariableMinification: false)
18 .getText(); 18 .getText();
19 19
20 Expect.stringEquals(expect.trim(), jsText.trim()); 20 Expect.stringEquals(expect.trim(), jsText.trim());
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 // Sequence is printed flattened 153 // Sequence is printed flattened
154 testStatement('x = #', [seq1], 'x = (1, 2, 3);'), 154 testStatement('x = #', [seq1], 'x = (1, 2, 3);'),
155 testStatement('x = (#, #)', [seq1, seq1], 'x = (1, 2, 3, 1, 2, 3);'), 155 testStatement('x = (#, #)', [seq1, seq1], 'x = (1, 2, 3, 1, 2, 3);'),
156 testStatement('x = #, #', [seq1, seq1], 'x = (1, 2, 3), 1, 2, 3;'), 156 testStatement('x = #, #', [seq1, seq1], 'x = (1, 2, 3), 1, 2, 3;'),
157 testStatement( 157 testStatement(
158 'for (i = 0, j = #, k = 0; ; ++i, ++j, ++k){}', [seq1], 158 'for (i = 0, j = #, k = 0; ; ++i, ++j, ++k){}', [seq1],
159 'for (i = 0, j = (1, 2, 3), k = 0;; ++i, ++j, ++k) {\n}'), 159 'for (i = 0, j = (1, 2, 3), k = 0;; ++i, ++j, ++k) {\n}'),
160 ])); 160 ]));
161 } 161 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/instantiated_classes_test.dart ('k') | tests/compiler/dart2js/js_parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698