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

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

Issue 12092020: Revert "Fix VariableDefinitions.endToken for formal parameters." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« no previous file with comments | « tests/compiler/dart2js/resolver_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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:uri'; 5 import 'dart:uri';
6 import 'parser_helper.dart'; 6 import 'parser_helper.dart';
7 import 'mock_compiler.dart'; 7 import 'mock_compiler.dart';
8 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; 8 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart';
9 9
10 testUnparse(String statement) { 10 testUnparse(String statement) {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 testUnparseTopLevelWithMetadata('typedef C = S<A> with M;'); 298 testUnparseTopLevelWithMetadata('typedef C = S<A> with M;');
299 testUnparseTopLevelWithMetadata('typedef C = S<A,B> with M;'); 299 testUnparseTopLevelWithMetadata('typedef C = S<A,B> with M;');
300 300
301 testUnparseTopLevelWithMetadata('typedef C = S with M<A>;'); 301 testUnparseTopLevelWithMetadata('typedef C = S with M<A>;');
302 testUnparseTopLevelWithMetadata('typedef C = S with M<A,B>;'); 302 testUnparseTopLevelWithMetadata('typedef C = S with M<A,B>;');
303 testUnparseTopLevelWithMetadata('typedef C = S with M1<A>,M2;'); 303 testUnparseTopLevelWithMetadata('typedef C = S with M1<A>,M2;');
304 testUnparseTopLevelWithMetadata('typedef C = S with M1,M2<A,B>;'); 304 testUnparseTopLevelWithMetadata('typedef C = S with M1,M2<A,B>;');
305 } 305 }
306 306
307 testUnparseParameters(List<String> variableDeclarations) {
308 var sb = new StringBuffer();
309 sb.add('Constructor(');
310 int index = 0;
311 for (String variableDeclaration in variableDeclarations) {
312 if (index != 0) {
313 sb.add(', ');
314 }
315 sb.add(variableDeclaration);
316 index++;
317 }
318 sb.add(');');
319
320 FunctionExpression node = parseMember(sb.toString());
321 index = 0;
322 for (VariableDefinitions parameter in node.parameters.nodes) {
323 Expect.equals(variableDeclarations[index], unparse(parameter));
324 index++;
325 }
326
327 }
328
329 testParameters() {
330 testUnparseParameters(
331 ["foo", "bar=0", "int baz", "int boz=0"]);
332 testUnparseParameters(
333 ["this.foo", "this.bar=0", "int this.baz", "int this.boz=0"]);
334 testUnparseParameters(
335 ["foo()", "void bar()", "int baz(a)", "int boz(int a,int b)=null"]);
336 testUnparseParameters(
337 ["this.foo()",
338 //"void this.bar()", // Commented out due to Issue 7852
339 //"int this.baz(a)", // Commented out due to Issue 7852
340 //"int this.boz(int a,int b)=null" // Commented out due to Issue 7852
341 ]);
342 }
343
344 main() { 307 main() {
345 testSignedConstants(); 308 testSignedConstants();
346 testGenericTypes(); 309 testGenericTypes();
347 testForLoop(); 310 testForLoop();
348 testEmptyList(); 311 testEmptyList();
349 testClosure(); 312 testClosure();
350 testIndexedOperatorDecl(); 313 testIndexedOperatorDecl();
351 testNativeMethods(); 314 testNativeMethods();
352 testPrefixIncrements(); 315 testPrefixIncrements();
353 testConstModifier(); 316 testConstModifier();
354 testSimpleObjectInstantiation(); 317 testSimpleObjectInstantiation();
355 testLibraryName(); 318 testLibraryName();
356 testImport(); 319 testImport();
357 testExport(); 320 testExport();
358 testPart(); 321 testPart();
359 testPartOf(); 322 testPartOf();
360 testCombinators(); 323 testCombinators();
361 testRedirectingFactoryConstructors(); 324 testRedirectingFactoryConstructors();
362 testClassDeclarations(); 325 testClassDeclarations();
363 testMixinApplications(); 326 testMixinApplications();
364 testParameters();
365 } 327 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698