OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 library analyzer.test.src.summary.resynthesize_kernel_test; | 5 library analyzer.test.src.summary.resynthesize_kernel_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
11 import 'package:analyzer/dart/ast/token.dart'; | 11 import 'package:analyzer/dart/ast/token.dart'; |
12 import 'package:analyzer/dart/element/element.dart'; | 12 import 'package:analyzer/dart/element/element.dart'; |
13 import 'package:analyzer/dart/element/type.dart'; | 13 import 'package:analyzer/dart/element/type.dart'; |
14 import 'package:analyzer/file_system/file_system.dart'; | 14 import 'package:analyzer/file_system/file_system.dart'; |
15 import 'package:analyzer/file_system/memory_file_system.dart'; | 15 import 'package:analyzer/file_system/memory_file_system.dart'; |
16 import 'package:analyzer/src/dart/element/element.dart'; | 16 import 'package:analyzer/src/dart/element/element.dart'; |
17 import 'package:analyzer/src/dart/element/type.dart'; | 17 import 'package:analyzer/src/dart/element/type.dart'; |
18 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 18 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
19 import 'package:analyzer/src/generated/source.dart'; | 19 import 'package:analyzer/src/generated/source.dart'; |
20 import 'package:analyzer/src/generated/testing/ast_test_factory.dart'; | 20 import 'package:analyzer/src/generated/testing/ast_test_factory.dart'; |
21 import 'package:analyzer/src/summary/resynthesize.dart'; | 21 import 'package:analyzer/src/summary/resynthesize.dart'; |
22 import 'package:front_end/file_system.dart'; | 22 import 'package:front_end/file_system.dart'; |
23 import 'package:front_end/src/base/performace_logger.dart'; | 23 import 'package:front_end/src/base/performace_logger.dart'; |
24 import 'package:front_end/src/fasta/uri_translator_impl.dart'; | 24 import 'package:front_end/src/fasta/uri_translator_impl.dart'; |
25 import 'package:front_end/src/incremental/byte_store.dart'; | 25 import 'package:front_end/src/incremental/byte_store.dart'; |
26 import 'package:front_end/src/incremental/kernel_driver.dart'; | 26 import 'package:front_end/src/incremental/kernel_driver.dart'; |
27 import 'package:kernel/kernel.dart' as kernel; | 27 import 'package:kernel/kernel.dart' as kernel; |
28 import 'package:kernel/target/targets.dart'; | 28 import 'package:kernel/target/targets.dart'; |
29 import 'package:kernel/type_environment.dart' as kernel; | |
30 import 'package:package_config/packages.dart'; | 29 import 'package:package_config/packages.dart'; |
31 import 'package:path/path.dart' as pathos; | 30 import 'package:path/path.dart' as pathos; |
32 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 31 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
33 | 32 |
34 import '../context/mock_sdk.dart'; | 33 import '../context/mock_sdk.dart'; |
35 import 'resynthesize_common.dart'; | 34 import 'resynthesize_common.dart'; |
36 | 35 |
37 main() { | 36 main() { |
38 defineReflectiveSuite(() { | 37 defineReflectiveSuite(() { |
39 defineReflectiveTests(ResynthesizeKernelStrongTest); | 38 defineReflectiveTests(ResynthesizeKernelStrongTest); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 await super | 137 await super |
139 .test_class_alias_with_forwarding_constructors_type_substitution_complex
(); | 138 .test_class_alias_with_forwarding_constructors_type_substitution_complex
(); |
140 } | 139 } |
141 | 140 |
142 @failingTest | 141 @failingTest |
143 test_class_alias_with_mixin_members() async { | 142 test_class_alias_with_mixin_members() async { |
144 await super.test_class_alias_with_mixin_members(); | 143 await super.test_class_alias_with_mixin_members(); |
145 } | 144 } |
146 | 145 |
147 @failingTest | 146 @failingTest |
148 test_class_constructor_field_formal_dynamic_dynamic() async { | |
149 await super.test_class_constructor_field_formal_dynamic_dynamic(); | |
150 } | |
151 | |
152 @failingTest | |
153 test_class_constructor_field_formal_dynamic_typed() async { | |
154 await super.test_class_constructor_field_formal_dynamic_typed(); | |
155 } | |
156 | |
157 @failingTest | |
158 test_class_constructor_field_formal_dynamic_untyped() async { | |
159 await super.test_class_constructor_field_formal_dynamic_untyped(); | |
160 } | |
161 | |
162 @failingTest | |
163 test_class_constructor_field_formal_multiple_matching_fields() async { | 147 test_class_constructor_field_formal_multiple_matching_fields() async { |
| 148 // Fasta does not generate the class. |
| 149 // main() with a fatal error is generated instead. |
164 await super.test_class_constructor_field_formal_multiple_matching_fields(); | 150 await super.test_class_constructor_field_formal_multiple_matching_fields(); |
165 } | 151 } |
166 | 152 |
167 @failingTest | 153 @failingTest |
168 test_class_constructor_field_formal_no_matching_field() async { | |
169 await super.test_class_constructor_field_formal_no_matching_field(); | |
170 } | |
171 | |
172 @failingTest | |
173 test_class_constructor_field_formal_typed_dynamic() async { | |
174 await super.test_class_constructor_field_formal_typed_dynamic(); | |
175 } | |
176 | |
177 @failingTest | |
178 test_class_constructor_field_formal_typed_typed() async { | |
179 await super.test_class_constructor_field_formal_typed_typed(); | |
180 } | |
181 | |
182 @failingTest | |
183 test_class_constructor_field_formal_typed_untyped() async { | |
184 await super.test_class_constructor_field_formal_typed_untyped(); | |
185 } | |
186 | |
187 @failingTest | |
188 test_class_constructor_field_formal_untyped_dynamic() async { | |
189 await super.test_class_constructor_field_formal_untyped_dynamic(); | |
190 } | |
191 | |
192 @failingTest | |
193 test_class_constructor_field_formal_untyped_typed() async { | |
194 await super.test_class_constructor_field_formal_untyped_typed(); | |
195 } | |
196 | |
197 @failingTest | |
198 test_class_constructor_field_formal_untyped_untyped() async { | |
199 await super.test_class_constructor_field_formal_untyped_untyped(); | |
200 } | |
201 | |
202 @failingTest | |
203 test_class_constructor_fieldFormal_named_noDefault() async { | |
204 await super.test_class_constructor_fieldFormal_named_noDefault(); | |
205 } | |
206 | |
207 @failingTest | |
208 test_class_constructor_fieldFormal_named_withDefault() async { | |
209 await super.test_class_constructor_fieldFormal_named_withDefault(); | |
210 } | |
211 | |
212 @failingTest | |
213 test_class_constructor_fieldFormal_optional_noDefault() async { | |
214 await super.test_class_constructor_fieldFormal_optional_noDefault(); | |
215 } | |
216 | |
217 @failingTest | |
218 test_class_constructor_fieldFormal_optional_withDefault() async { | |
219 await super.test_class_constructor_fieldFormal_optional_withDefault(); | |
220 } | |
221 | |
222 @failingTest | |
223 test_class_documented_tripleSlash() async { | 154 test_class_documented_tripleSlash() async { |
224 await super.test_class_documented_tripleSlash(); | 155 await super.test_class_documented_tripleSlash(); |
225 } | 156 } |
226 | 157 |
227 @failingTest | 158 @failingTest |
228 test_class_documented_withLeadingNotDocumentation() async { | 159 test_class_documented_withLeadingNotDocumentation() async { |
229 await super.test_class_documented_withLeadingNotDocumentation(); | 160 await super.test_class_documented_withLeadingNotDocumentation(); |
230 } | 161 } |
231 | 162 |
232 @failingTest | 163 @failingTest |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 test_const_length_ofTopLevelVariable_imported_withPrefix() async { | 356 test_const_length_ofTopLevelVariable_imported_withPrefix() async { |
426 await super.test_const_length_ofTopLevelVariable_imported_withPrefix(); | 357 await super.test_const_length_ofTopLevelVariable_imported_withPrefix(); |
427 } | 358 } |
428 | 359 |
429 @failingTest | 360 @failingTest |
430 test_const_length_staticMethod() async { | 361 test_const_length_staticMethod() async { |
431 await super.test_const_length_staticMethod(); | 362 await super.test_const_length_staticMethod(); |
432 } | 363 } |
433 | 364 |
434 @failingTest | 365 @failingTest |
435 test_const_parameterDefaultValue_initializingFormal_functionTyped() async { | |
436 await super | |
437 .test_const_parameterDefaultValue_initializingFormal_functionTyped(); | |
438 } | |
439 | |
440 @failingTest | |
441 test_const_parameterDefaultValue_initializingFormal_named() async { | |
442 await super.test_const_parameterDefaultValue_initializingFormal_named(); | |
443 } | |
444 | |
445 @failingTest | |
446 test_const_parameterDefaultValue_initializingFormal_positional() async { | |
447 await super | |
448 .test_const_parameterDefaultValue_initializingFormal_positional(); | |
449 } | |
450 | |
451 @failingTest | |
452 test_const_parameterDefaultValue_normal() async { | |
453 await super.test_const_parameterDefaultValue_normal(); | |
454 } | |
455 | |
456 @failingTest | |
457 test_const_reference_staticField_imported() async { | 366 test_const_reference_staticField_imported() async { |
458 await super.test_const_reference_staticField_imported(); | 367 await super.test_const_reference_staticField_imported(); |
459 } | 368 } |
460 | 369 |
461 @failingTest | 370 @failingTest |
462 test_const_reference_staticField_imported_withPrefix() async { | 371 test_const_reference_staticField_imported_withPrefix() async { |
463 await super.test_const_reference_staticField_imported_withPrefix(); | 372 await super.test_const_reference_staticField_imported_withPrefix(); |
464 } | 373 } |
465 | 374 |
466 @failingTest | 375 @failingTest |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 test_field_covariant() async { | 812 test_field_covariant() async { |
904 await super.test_field_covariant(); | 813 await super.test_field_covariant(); |
905 } | 814 } |
906 | 815 |
907 @failingTest | 816 @failingTest |
908 test_field_documented() async { | 817 test_field_documented() async { |
909 await super.test_field_documented(); | 818 await super.test_field_documented(); |
910 } | 819 } |
911 | 820 |
912 @failingTest | 821 @failingTest |
913 test_field_formal_param_inferred_type_implicit() async { | |
914 await super.test_field_formal_param_inferred_type_implicit(); | |
915 } | |
916 | |
917 @failingTest | |
918 test_field_propagatedType_final_dep_inLib() async { | 822 test_field_propagatedType_final_dep_inLib() async { |
919 await super.test_field_propagatedType_final_dep_inLib(); | 823 await super.test_field_propagatedType_final_dep_inLib(); |
920 } | 824 } |
921 | 825 |
922 @failingTest | 826 @failingTest |
923 test_field_propagatedType_final_dep_inPart() async { | 827 test_field_propagatedType_final_dep_inPart() async { |
924 await super.test_field_propagatedType_final_dep_inPart(); | 828 await super.test_field_propagatedType_final_dep_inPart(); |
925 } | 829 } |
926 | 830 |
927 @failingTest | 831 @failingTest |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 test_parameter_return_type() async { | 1571 test_parameter_return_type() async { |
1668 await super.test_parameter_return_type(); | 1572 await super.test_parameter_return_type(); |
1669 } | 1573 } |
1670 | 1574 |
1671 @failingTest | 1575 @failingTest |
1672 test_parameter_return_type_void() async { | 1576 test_parameter_return_type_void() async { |
1673 await super.test_parameter_return_type_void(); | 1577 await super.test_parameter_return_type_void(); |
1674 } | 1578 } |
1675 | 1579 |
1676 @failingTest | 1580 @failingTest |
1677 test_parameterTypeNotInferred_constructor() async { | |
1678 await super.test_parameterTypeNotInferred_constructor(); | |
1679 } | |
1680 | |
1681 @failingTest | |
1682 test_parameterTypeNotInferred_initializingFormal() async { | |
1683 await super.test_parameterTypeNotInferred_initializingFormal(); | |
1684 } | |
1685 | |
1686 @failingTest | |
1687 test_parameterTypeNotInferred_staticMethod() async { | |
1688 await super.test_parameterTypeNotInferred_staticMethod(); | |
1689 } | |
1690 | |
1691 @failingTest | |
1692 test_parameterTypeNotInferred_topLevelFunction() async { | |
1693 await super.test_parameterTypeNotInferred_topLevelFunction(); | |
1694 } | |
1695 | |
1696 @failingTest | |
1697 test_parts() async { | 1581 test_parts() async { |
1698 await super.test_parts(); | 1582 await super.test_parts(); |
1699 } | 1583 } |
1700 | 1584 |
1701 @failingTest | 1585 @failingTest |
1702 test_parts_invalidUri() async { | 1586 test_parts_invalidUri() async { |
1703 await super.test_parts_invalidUri(); | 1587 await super.test_parts_invalidUri(); |
1704 } | 1588 } |
1705 | 1589 |
1706 @failingTest | 1590 @failingTest |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 } | 2384 } |
2501 | 2385 |
2502 /** | 2386 /** |
2503 * Get the [Source] object for the given [uri]. | 2387 * Get the [Source] object for the given [uri]. |
2504 */ | 2388 */ |
2505 Source _getSource(String uri) { | 2389 Source _getSource(String uri) { |
2506 return _sources.putIfAbsent( | 2390 return _sources.putIfAbsent( |
2507 uri, () => _analysisContext.sourceFactory.forUri(uri)); | 2391 uri, () => _analysisContext.sourceFactory.forUri(uri)); |
2508 } | 2392 } |
2509 } | 2393 } |
OLD | NEW |