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

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

Issue 10844002: dart2dart Fix default class unparse (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « lib/compiler/implementation/dart_backend/emitter.dart ('k') | tests/language/language.status » ('j') | 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("../../../lib/compiler/compiler.dart"); 7 #import("../../../lib/compiler/compiler.dart");
8 #import("../../../lib/compiler/implementation/tree/tree.dart"); 8 #import("../../../lib/compiler/implementation/tree/tree.dart");
9 9
10 testUnparse(String statement) { 10 testUnparse(String statement) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 '''; 382 ''';
383 var expectedResult = @'topfoo(){}p_topfoo(){var x=5;}A getA()=> null;' 383 var expectedResult = @'topfoo(){}p_topfoo(){var x=5;}A getA()=> null;'
384 @'main(){var a=new A(); a.foo(); var b=new p_A.fromFoo(); b.foo(); ' 384 @'main(){var a=new A(); a.foo(); var b=new p_A.fromFoo(); b.foo(); '
385 @'var GREATVAR=b.myliba; b.mylist; a=getA(); p_topfoo(); topfoo();}' 385 @'var GREATVAR=b.myliba; b.mylist; a=getA(); p_topfoo(); topfoo();}'
386 @'class p_A{p_A.fromFoo(){}List<p_A> mylist;num foo(){}A myliba;}' 386 @'class p_A{p_A.fromFoo(){}List<p_A> mylist;num foo(){}A myliba;}'
387 @'class A{foo(){}}'; 387 @'class A{foo(){}}';
388 testDart2DartWithLibrary(mainSrc, librarySrc, 388 testDart2DartWithLibrary(mainSrc, librarySrc,
389 (String result) { Expect.equals(expectedResult, result); }); 389 (String result) { Expect.equals(expectedResult, result); });
390 } 390 }
391 391
392 testDefaultClassWithArgs() {
393 testDart2Dart('main(){var result=new IA<String>();}'
394 'interface IA<T> default A<T extends Object>{IA();}'
395 'class A<T extends Object> implements IA<T>{factory A(){}}');
396 }
397
398 testClassExtendsWithArgs() {
399 testDart2Dart('main(){new B<Object>();}'
400 'class A<T extends Object>{}'
401 'class B<T extends Object> extends A<T>{}');
402 }
403
392 testStaticInvocation() { 404 testStaticInvocation() {
393 testDart2Dart('main(){var x=Math.parseDouble("1");}'); 405 testDart2Dart('main(){var x=Math.parseDouble("1");}');
394 } 406 }
395 407
396 main() { 408 main() {
397 testSignedConstants(); 409 testSignedConstants();
398 testGenericTypes(); 410 testGenericTypes();
399 testForLoop(); 411 testForLoop();
400 testEmptyList(); 412 testEmptyList();
401 testClosure(); 413 testClosure();
402 testIndexedOperatorDecl(); 414 testIndexedOperatorDecl();
403 testNativeMethods(); 415 testNativeMethods();
404 testPrefixIncrements(); 416 testPrefixIncrements();
405 testConstModifier(); 417 testConstModifier();
406 testStaticInvocation(); 418 testStaticInvocation();
407 testSimpleFileUnparse(); 419 testSimpleFileUnparse();
408 testSimpleObjectInstantiation(); 420 testSimpleObjectInstantiation();
409 testSimpleTopLevelClass(); 421 testSimpleTopLevelClass();
410 testClassWithSynthesizedConstructor(); 422 testClassWithSynthesizedConstructor();
411 testClassWithMethod(); 423 testClassWithMethod();
412 testVariableDefinitions(); 424 testVariableDefinitions();
413 testGetSet(); 425 testGetSet();
414 testFactoryConstructor(); 426 testFactoryConstructor();
415 testTopLevelField(); 427 testTopLevelField();
416 testAbstractClass(); 428 testAbstractClass();
417 testConflictLibraryClassRename(); 429 testConflictLibraryClassRename();
418 testNoConflictSendsRename(); 430 testNoConflictSendsRename();
419 testConflictSendsRename(); 431 testConflictSendsRename();
432 testDefaultClassWithArgs();
433 testClassExtendsWithArgs();
420 } 434 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/dart_backend/emitter.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698