| OLD | NEW |
| 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 /// Test data for the end2end test. | 5 /// Test data for the end2end test. |
| 6 library test.end2end.data; | 6 library test.end2end.data; |
| 7 | 7 |
| 8 import 'test_helper.dart' show Group; | 8 import 'test_helper.dart' show Group; |
| 9 import 'test_helper.dart' as base show TestSpec; | 9 import 'test_helper.dart' as base show TestSpec; |
| 10 | 10 |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 ''', ''' | 729 ''', ''' |
| 730 main(a) { | 730 main(a) { |
| 731 var i, v0 = a.iterator; | 731 var i, v0 = a.iterator; |
| 732 while (v0.moveNext()) { | 732 while (v0.moveNext()) { |
| 733 i = v0.current; | 733 i = v0.current; |
| 734 print(i); | 734 print(i); |
| 735 } | 735 } |
| 736 } | 736 } |
| 737 '''), | 737 '''), |
| 738 ]), | 738 ]), |
| 739 |
| 740 const Group('Local functions', const <TestSpec>[ |
| 741 const TestSpec(''' |
| 742 main(a) { |
| 743 local() {} |
| 744 return local(); |
| 745 } |
| 746 ''', ''' |
| 747 main(a) { |
| 748 return (() {})(); |
| 749 } |
| 750 '''), |
| 751 |
| 752 const TestSpec(''' |
| 753 main(a) { |
| 754 local() {} |
| 755 var l = local; |
| 756 return l(); |
| 757 } |
| 758 ''', ''' |
| 759 main(a) { |
| 760 return (() {})(); |
| 761 } |
| 762 '''), |
| 763 |
| 764 const TestSpec(''' |
| 765 main(a) { |
| 766 return () {}(); |
| 767 } |
| 768 ''', ''' |
| 769 main(a) { |
| 770 return (() {})(); |
| 771 } |
| 772 '''), |
| 773 |
| 774 const TestSpec(''' |
| 775 main(a) { |
| 776 var c = a ? () { return 0; } : () { return 1; } |
| 777 return c(); |
| 778 } |
| 779 ''', ''' |
| 780 main(a) { |
| 781 return (a ? () { |
| 782 return 0; |
| 783 } : () { |
| 784 return 1; |
| 785 })(); |
| 786 } |
| 787 '''), |
| 788 ]), |
| 739 ]; | 789 ]; |
| OLD | NEW |