| OLD | NEW |
| 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("../../../lib/compiler/compiler.dart"); | 8 #import("../../../lib/compiler/compiler.dart"); |
| 9 #import("../../../lib/compiler/implementation/dart_backend/dart_backend.dart"); | 9 #import("../../../lib/compiler/implementation/dart_backend/dart_backend.dart"); |
| 10 #import("../../../lib/compiler/implementation/elements/elements.dart"); | 10 #import("../../../lib/compiler/implementation/elements/elements.dart"); |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 mylib.main(); | 597 mylib.main(); |
| 598 } | 598 } |
| 599 '''; | 599 '''; |
| 600 var expectedResult = | 600 var expectedResult = |
| 601 'p_main(){}' | 601 'p_main(){}' |
| 602 'main(){p_main();}'; | 602 'main(){p_main();}'; |
| 603 testDart2DartWithLibrary(mainSrc, librarySrc, | 603 testDart2DartWithLibrary(mainSrc, librarySrc, |
| 604 (String result) { Expect.equals(expectedResult, result); }); | 604 (String result) { Expect.equals(expectedResult, result); }); |
| 605 } | 605 } |
| 606 | 606 |
| 607 testInterfaceDefaultAnotherLib() { |
| 608 var librarySrc = ''' |
| 609 #library('mylib'); |
| 610 class C<T> { |
| 611 factory I() {} |
| 612 } |
| 613 '''; |
| 614 var mainSrc = ''' |
| 615 #import('mylib.dart', prefix: 'mylib'); |
| 616 |
| 617 interface I<T> default mylib.C<T> { |
| 618 I(); |
| 619 } |
| 620 |
| 621 main() { |
| 622 new I(); |
| 623 } |
| 624 '''; |
| 625 var expectedResult = |
| 626 'class C<T>{factory I(){}}' |
| 627 'interface I<T> default C<T>{I();}' |
| 628 'main(){new I();}'; |
| 629 testDart2DartWithLibrary(mainSrc, librarySrc, |
| 630 (String result) { Expect.equals(expectedResult, result); }); |
| 631 } |
| 632 |
| 607 main() { | 633 main() { |
| 608 testSignedConstants(); | 634 testSignedConstants(); |
| 609 testGenericTypes(); | 635 testGenericTypes(); |
| 610 testForLoop(); | 636 testForLoop(); |
| 611 testEmptyList(); | 637 testEmptyList(); |
| 612 testClosure(); | 638 testClosure(); |
| 613 testIndexedOperatorDecl(); | 639 testIndexedOperatorDecl(); |
| 614 testNativeMethods(); | 640 testNativeMethods(); |
| 615 testPrefixIncrements(); | 641 testPrefixIncrements(); |
| 616 testConstModifier(); | 642 testConstModifier(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 631 testDefaultClassWithArgs(); | 657 testDefaultClassWithArgs(); |
| 632 testClassExtendsWithArgs(); | 658 testClassExtendsWithArgs(); |
| 633 testStaticInvocation(); | 659 testStaticInvocation(); |
| 634 testLibraryGetSet(); | 660 testLibraryGetSet(); |
| 635 testFieldTypeOutput(); | 661 testFieldTypeOutput(); |
| 636 testDefaultClassNamePlaceholder(); | 662 testDefaultClassNamePlaceholder(); |
| 637 testFactoryRename(); | 663 testFactoryRename(); |
| 638 testTypeVariablesAreRenamed(); | 664 testTypeVariablesAreRenamed(); |
| 639 testClassTypeArgumentBound(); | 665 testClassTypeArgumentBound(); |
| 640 testDoubleMains(); | 666 testDoubleMains(); |
| 667 testInterfaceDefaultAnotherLib(); |
| 641 } | 668 } |
| OLD | NEW |