| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.task.dart_test; | 5 library test.src.task.dart_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/context/cache.dart'; | 7 import 'package:analyzer/src/context/cache.dart'; |
| 8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
| 9 import 'package:analyzer/src/generated/constant.dart'; | 9 import 'package:analyzer/src/generated/constant.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2880 '''); | 2880 '''); |
| 2881 computeResult( | 2881 computeResult( |
| 2882 new LibrarySpecificUnit(firstSource, firstSource), RESOLVED_UNIT8); | 2882 new LibrarySpecificUnit(firstSource, firstSource), RESOLVED_UNIT8); |
| 2883 CompilationUnit unit1 = outputs[RESOLVED_UNIT8]; | 2883 CompilationUnit unit1 = outputs[RESOLVED_UNIT8]; |
| 2884 computeResult( | 2884 computeResult( |
| 2885 new LibrarySpecificUnit(secondSource, secondSource), RESOLVED_UNIT8); | 2885 new LibrarySpecificUnit(secondSource, secondSource), RESOLVED_UNIT8); |
| 2886 CompilationUnit unit2 = outputs[RESOLVED_UNIT8]; | 2886 CompilationUnit unit2 = outputs[RESOLVED_UNIT8]; |
| 2887 | 2887 |
| 2888 InterfaceType intType = context.typeProvider.intType; | 2888 InterfaceType intType = context.typeProvider.intType; |
| 2889 InterfaceType stringType = context.typeProvider.stringType; | 2889 InterfaceType stringType = context.typeProvider.stringType; |
| 2890 DartType dynamicType = context.typeProvider.dynamicType; | |
| 2891 | 2890 |
| 2892 assertVariableDeclarationTypes( | 2891 assertVariableDeclarationTypes( |
| 2893 getTopLevelVariable(unit1, "x"), intType, intType); | 2892 getTopLevelVariable(unit1, "x"), intType, intType); |
| 2894 assertVariableDeclarationTypes( | 2893 assertVariableDeclarationTypes( |
| 2895 getFieldInClass(unit1, "A", "x"), intType, intType); | 2894 getFieldInClass(unit1, "A", "x"), intType, intType); |
| 2896 | 2895 |
| 2897 assertVariableDeclarationTypes( | 2896 assertVariableDeclarationTypes( |
| 2898 getTopLevelVariable(unit2, "y"), intType, intType); | 2897 getTopLevelVariable(unit2, "y"), intType, intType); |
| 2899 assertVariableDeclarationTypes( | 2898 assertVariableDeclarationTypes( |
| 2900 getFieldInClass(unit2, "B", "y"), intType, intType); | 2899 getFieldInClass(unit2, "B", "y"), intType, intType); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2931 } | 2930 } |
| 2932 '''); | 2931 '''); |
| 2933 computeResult( | 2932 computeResult( |
| 2934 new LibrarySpecificUnit(firstSource, firstSource), RESOLVED_UNIT8); | 2933 new LibrarySpecificUnit(firstSource, firstSource), RESOLVED_UNIT8); |
| 2935 CompilationUnit unit1 = outputs[RESOLVED_UNIT8]; | 2934 CompilationUnit unit1 = outputs[RESOLVED_UNIT8]; |
| 2936 computeResult( | 2935 computeResult( |
| 2937 new LibrarySpecificUnit(secondSource, secondSource), RESOLVED_UNIT8); | 2936 new LibrarySpecificUnit(secondSource, secondSource), RESOLVED_UNIT8); |
| 2938 CompilationUnit unit2 = outputs[RESOLVED_UNIT8]; | 2937 CompilationUnit unit2 = outputs[RESOLVED_UNIT8]; |
| 2939 | 2938 |
| 2940 InterfaceType intType = context.typeProvider.intType; | 2939 InterfaceType intType = context.typeProvider.intType; |
| 2941 InterfaceType stringType = context.typeProvider.stringType; | |
| 2942 | 2940 |
| 2943 assertVariableDeclarationTypes( | 2941 assertVariableDeclarationTypes( |
| 2944 getTopLevelVariable(unit1, "x"), intType, intType); | 2942 getTopLevelVariable(unit1, "x"), intType, intType); |
| 2945 assertVariableDeclarationTypes( | 2943 assertVariableDeclarationTypes( |
| 2946 getFieldInClass(unit1, "A", "x"), intType, intType); | 2944 getFieldInClass(unit1, "A", "x"), intType, intType); |
| 2947 | 2945 |
| 2948 assertVariableDeclarationTypes( | 2946 assertVariableDeclarationTypes( |
| 2949 getTopLevelVariable(unit2, "y"), intType, intType); | 2947 getTopLevelVariable(unit2, "y"), intType, intType); |
| 2950 assertVariableDeclarationTypes( | 2948 assertVariableDeclarationTypes( |
| 2951 getFieldInClass(unit2, "B", "y"), intType, intType); | 2949 getFieldInClass(unit2, "B", "y"), intType, intType); |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3585 /** | 3583 /** |
| 3586 * Fill [errorListener] with [result] errors in the current [task]. | 3584 * Fill [errorListener] with [result] errors in the current [task]. |
| 3587 */ | 3585 */ |
| 3588 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 3586 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
| 3589 List<AnalysisError> errors = task.outputs[result]; | 3587 List<AnalysisError> errors = task.outputs[result]; |
| 3590 expect(errors, isNotNull, reason: result.name); | 3588 expect(errors, isNotNull, reason: result.name); |
| 3591 errorListener = new GatheringErrorListener(); | 3589 errorListener = new GatheringErrorListener(); |
| 3592 errorListener.addAll(errors); | 3590 errorListener.addAll(errors); |
| 3593 } | 3591 } |
| 3594 } | 3592 } |
| OLD | NEW |