| 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'; |
| 9 import 'test_helper.dart' as base show TestSpec; | |
| 10 | 9 |
| 11 class TestSpec extends base.TestSpec { | 10 class TestSpec extends TestSpecBase { |
| 11 final String output; |
| 12 |
| 12 const TestSpec(String input, [String output]) | 13 const TestSpec(String input, [String output]) |
| 13 : super(input, output != null ? output : input); | 14 : this.output = output != null ? output : input, |
| 15 super(input); |
| 14 } | 16 } |
| 15 | 17 |
| 16 const List<Group> TEST_DATA = const <Group>[ | 18 const List<Group> TEST_DATA = const <Group>[ |
| 17 const Group('Empty main', const <TestSpec>[ | 19 const Group('Empty main', const <TestSpec>[ |
| 18 const TestSpec(''' | 20 const TestSpec(''' |
| 19 main() {} | 21 main() {} |
| 20 '''), | 22 '''), |
| 21 | 23 |
| 22 const TestSpec(''' | 24 const TestSpec(''' |
| 23 main() {} | 25 main() {} |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 bar(b) {} | 156 bar(b) {} |
| 155 foo(a) { | 157 foo(a) { |
| 156 bar(a); | 158 bar(a); |
| 157 } | 159 } |
| 158 main() { | 160 main() { |
| 159 foo(null); | 161 foo(null); |
| 160 } | 162 } |
| 161 '''), | 163 '''), |
| 162 ]), | 164 ]), |
| 163 | 165 |
| 164 const Group('Top level field access', const <TestSpec>[ | 166 const Group('Top level field', const <TestSpec>[ |
| 165 const TestSpec(''' | 167 const TestSpec(''' |
| 166 main(args) { | 168 main(args) { |
| 167 return deprecated; | 169 return deprecated; |
| 168 } | 170 } |
| 169 '''), | 171 '''), |
| 172 |
| 173 const TestSpec(''' |
| 174 var field; |
| 175 main(args) { |
| 176 return field; |
| 177 } |
| 178 '''), |
| 179 |
| 180 // TODO(johnniwinther): Eliminate unneeded `null` initializers. |
| 181 const TestSpec(''' |
| 182 var field = null; |
| 183 main(args) { |
| 184 return field; |
| 185 } |
| 186 '''), |
| 187 |
| 188 const TestSpec(''' |
| 189 var field = 0; |
| 190 main(args) { |
| 191 return field; |
| 192 } |
| 193 '''), |
| 194 |
| 195 const TestSpec(''' |
| 196 var field; |
| 197 main(args) { |
| 198 field = args.length; |
| 199 return field; |
| 200 } |
| 201 '''), |
| 170 ]), | 202 ]), |
| 171 | 203 |
| 172 const Group('Local variables', const <TestSpec>[ | 204 const Group('Local variables', const <TestSpec>[ |
| 173 const TestSpec(''' | 205 const TestSpec(''' |
| 174 main() { | 206 main() { |
| 175 var a; | 207 var a; |
| 176 return a; | 208 return a; |
| 177 } | 209 } |
| 178 ''',''' | 210 ''',''' |
| 179 main() {} | 211 main() {} |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 return () {}(); | 798 return () {}(); |
| 767 } | 799 } |
| 768 ''', ''' | 800 ''', ''' |
| 769 main(a) { | 801 main(a) { |
| 770 return (() {})(); | 802 return (() {})(); |
| 771 } | 803 } |
| 772 '''), | 804 '''), |
| 773 | 805 |
| 774 const TestSpec(''' | 806 const TestSpec(''' |
| 775 main(a) { | 807 main(a) { |
| 776 var c = a ? () { return 0; } : () { return 1; } | 808 var c = a ? () { return 0; } : () { return 1; }; |
| 777 return c(); | 809 return c(); |
| 778 } | 810 } |
| 779 ''', ''' | 811 ''', ''' |
| 780 main(a) { | 812 main(a) { |
| 781 return (a ? () { | 813 return (a ? () { |
| 782 return 0; | 814 return 0; |
| 783 } : () { | 815 } : () { |
| 784 return 1; | 816 return 1; |
| 785 })(); | 817 })(); |
| 786 } | 818 } |
| 787 '''), | 819 '''), |
| 788 ]), | 820 ]), |
| 789 ]; | 821 ]; |
| OLD | NEW |