Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1053013004: Rename UsedElements -> UsedLocalElements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/file_system/file_system.dart'; 7 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/file_system/memory_file_system.dart'; 8 import 'package:analyzer/file_system/memory_file_system.dart';
9 import 'package:analyzer/src/context/cache.dart'; 9 import 'package:analyzer/src/context/cache.dart';
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 24 matching lines...) Expand all
35 runReflectiveTests(BuildCompilationUnitElementTaskTest); 35 runReflectiveTests(BuildCompilationUnitElementTaskTest);
36 runReflectiveTests(BuildDirectiveElementsTaskTest); 36 runReflectiveTests(BuildDirectiveElementsTaskTest);
37 runReflectiveTests(BuildEnumMemberElementsTaskTest); 37 runReflectiveTests(BuildEnumMemberElementsTaskTest);
38 runReflectiveTests(BuildSourceClosuresTaskTest); 38 runReflectiveTests(BuildSourceClosuresTaskTest);
39 runReflectiveTests(BuildExportNamespaceTaskTest); 39 runReflectiveTests(BuildExportNamespaceTaskTest);
40 runReflectiveTests(BuildFunctionTypeAliasesTaskTest); 40 runReflectiveTests(BuildFunctionTypeAliasesTaskTest);
41 runReflectiveTests(BuildLibraryConstructorsTaskTest); 41 runReflectiveTests(BuildLibraryConstructorsTaskTest);
42 runReflectiveTests(BuildLibraryElementTaskTest); 42 runReflectiveTests(BuildLibraryElementTaskTest);
43 runReflectiveTests(BuildPublicNamespaceTaskTest); 43 runReflectiveTests(BuildPublicNamespaceTaskTest);
44 runReflectiveTests(BuildTypeProviderTaskTest); 44 runReflectiveTests(BuildTypeProviderTaskTest);
45 runReflectiveTests(GatherUsedElementsTaskTest); 45 runReflectiveTests(GatherUsedLocalElementsTaskTest);
46 runReflectiveTests(GenerateHintsTaskTest); 46 runReflectiveTests(GenerateHintsTaskTest);
47 runReflectiveTests(ParseDartTaskTest); 47 runReflectiveTests(ParseDartTaskTest);
48 runReflectiveTests(ResolveUnitTypeNamesTaskTest); 48 runReflectiveTests(ResolveUnitTypeNamesTaskTest);
49 runReflectiveTests(ResolveLibraryTypeNamesTaskTest); 49 runReflectiveTests(ResolveLibraryTypeNamesTaskTest);
50 runReflectiveTests(ResolveReferencesTaskTest); 50 runReflectiveTests(ResolveReferencesTaskTest);
51 runReflectiveTests(ResolveVariableReferencesTaskTest); 51 runReflectiveTests(ResolveVariableReferencesTaskTest);
52 runReflectiveTests(ScanDartTaskTest); 52 runReflectiveTests(ScanDartTaskTest);
53 runReflectiveTests(VerifyUnitTaskTest); 53 runReflectiveTests(VerifyUnitTaskTest);
54 } 54 }
55 55
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 // validate 1116 // validate
1117 TypeProvider typeProvider = outputs[TYPE_PROVIDER]; 1117 TypeProvider typeProvider = outputs[TYPE_PROVIDER];
1118 expect(typeProvider, isNotNull); 1118 expect(typeProvider, isNotNull);
1119 expect(typeProvider.boolType, isNotNull); 1119 expect(typeProvider.boolType, isNotNull);
1120 expect(typeProvider.intType, isNotNull); 1120 expect(typeProvider.intType, isNotNull);
1121 expect(typeProvider.futureType, isNotNull); 1121 expect(typeProvider.futureType, isNotNull);
1122 } 1122 }
1123 } 1123 }
1124 1124
1125 @reflectiveTest 1125 @reflectiveTest
1126 class GatherUsedElementsTaskTest extends _AbstractDartTaskTest { 1126 class GatherUsedLocalElementsTaskTest extends _AbstractDartTaskTest {
1127 UsedElements usedElements; 1127 UsedLocalElements usedElements;
1128 Set<String> usedElementNames; 1128 Set<String> usedElementNames;
1129 1129
1130 test_perform_localVariable() { 1130 test_perform_localVariable() {
1131 Source source = _newSource('/test.dart', r''' 1131 Source source = _newSource('/test.dart', r'''
1132 main() { 1132 main() {
1133 var v1 = 1; 1133 var v1 = 1;
1134 var v2 = 2; 1134 var v2 = 2;
1135 print(v2); 1135 print(v2);
1136 }'''); 1136 }''');
1137 _computeUsedElements(source); 1137 _computeUsedElements(source);
(...skipping 14 matching lines...) Expand all
1152 } 1152 }
1153 '''); 1153 ''');
1154 _computeUsedElements(source); 1154 _computeUsedElements(source);
1155 // validate 1155 // validate
1156 expect(usedElementNames, unorderedEquals(['A', 'a', 'p', '_m2'])); 1156 expect(usedElementNames, unorderedEquals(['A', 'a', 'p', '_m2']));
1157 expect(usedElements.members, unorderedEquals(['_m2', '_m3'])); 1157 expect(usedElements.members, unorderedEquals(['_m2', '_m3']));
1158 } 1158 }
1159 1159
1160 void _computeUsedElements(Source source) { 1160 void _computeUsedElements(Source source) {
1161 LibraryUnitTarget target = new LibraryUnitTarget(source, source); 1161 LibraryUnitTarget target = new LibraryUnitTarget(source, source);
1162 _computeResult(target, USED_ELEMENTS); 1162 _computeResult(target, USED_LOCAL_ELEMENTS);
1163 expect(task, new isInstanceOf<GatherUsedElementsTask>()); 1163 expect(task, new isInstanceOf<GatherUsedLocalElementsTask>());
1164 usedElements = outputs[USED_ELEMENTS]; 1164 usedElements = outputs[USED_LOCAL_ELEMENTS];
1165 usedElementNames = usedElements.elements.map((e) => e.name).toSet(); 1165 usedElementNames = usedElements.elements.map((e) => e.name).toSet();
1166 } 1166 }
1167 } 1167 }
1168 1168
1169 @reflectiveTest 1169 @reflectiveTest
1170 class GenerateHintsTaskTest extends _AbstractDartTaskTest { 1170 class GenerateHintsTaskTest extends _AbstractDartTaskTest {
1171 test_perform_bestPractices_missingReturn() { 1171 test_perform_bestPractices_missingReturn() {
1172 Source source = _newSource('/test.dart', ''' 1172 Source source = _newSource('/test.dart', '''
1173 int main() { 1173 int main() {
1174 } 1174 }
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 taskManager.addTaskDescriptor(BuildCompilationUnitElementTask.DESCRIPTOR); 1736 taskManager.addTaskDescriptor(BuildCompilationUnitElementTask.DESCRIPTOR);
1737 taskManager.addTaskDescriptor(BuildLibraryConstructorsTask.DESCRIPTOR); 1737 taskManager.addTaskDescriptor(BuildLibraryConstructorsTask.DESCRIPTOR);
1738 taskManager.addTaskDescriptor(BuildLibraryElementTask.DESCRIPTOR); 1738 taskManager.addTaskDescriptor(BuildLibraryElementTask.DESCRIPTOR);
1739 taskManager.addTaskDescriptor(BuildPublicNamespaceTask.DESCRIPTOR); 1739 taskManager.addTaskDescriptor(BuildPublicNamespaceTask.DESCRIPTOR);
1740 taskManager.addTaskDescriptor(BuildDirectiveElementsTask.DESCRIPTOR); 1740 taskManager.addTaskDescriptor(BuildDirectiveElementsTask.DESCRIPTOR);
1741 taskManager.addTaskDescriptor(BuildSourceClosuresTask.DESCRIPTOR); 1741 taskManager.addTaskDescriptor(BuildSourceClosuresTask.DESCRIPTOR);
1742 taskManager.addTaskDescriptor(BuildExportNamespaceTask.DESCRIPTOR); 1742 taskManager.addTaskDescriptor(BuildExportNamespaceTask.DESCRIPTOR);
1743 taskManager.addTaskDescriptor(BuildEnumMemberElementsTask.DESCRIPTOR); 1743 taskManager.addTaskDescriptor(BuildEnumMemberElementsTask.DESCRIPTOR);
1744 taskManager.addTaskDescriptor(BuildFunctionTypeAliasesTask.DESCRIPTOR); 1744 taskManager.addTaskDescriptor(BuildFunctionTypeAliasesTask.DESCRIPTOR);
1745 taskManager.addTaskDescriptor(BuildTypeProviderTask.DESCRIPTOR); 1745 taskManager.addTaskDescriptor(BuildTypeProviderTask.DESCRIPTOR);
1746 taskManager.addTaskDescriptor(GatherUsedElementsTask.DESCRIPTOR); 1746 taskManager.addTaskDescriptor(GatherUsedLocalElementsTask.DESCRIPTOR);
1747 taskManager.addTaskDescriptor(GenerateHintsTask.DESCRIPTOR); 1747 taskManager.addTaskDescriptor(GenerateHintsTask.DESCRIPTOR);
1748 taskManager.addTaskDescriptor(ResolveUnitTypeNamesTask.DESCRIPTOR); 1748 taskManager.addTaskDescriptor(ResolveUnitTypeNamesTask.DESCRIPTOR);
1749 taskManager.addTaskDescriptor(ResolveLibraryTypeNamesTask.DESCRIPTOR); 1749 taskManager.addTaskDescriptor(ResolveLibraryTypeNamesTask.DESCRIPTOR);
1750 taskManager.addTaskDescriptor(ResolveReferencesTask.DESCRIPTOR); 1750 taskManager.addTaskDescriptor(ResolveReferencesTask.DESCRIPTOR);
1751 taskManager.addTaskDescriptor(ResolveVariableReferencesTask.DESCRIPTOR); 1751 taskManager.addTaskDescriptor(ResolveVariableReferencesTask.DESCRIPTOR);
1752 taskManager.addTaskDescriptor(VerifyUnitTask.DESCRIPTOR); 1752 taskManager.addTaskDescriptor(VerifyUnitTask.DESCRIPTOR);
1753 // prepare AnalysisDriver 1753 // prepare AnalysisDriver
1754 analysisDriver = new AnalysisDriver(taskManager, context); 1754 analysisDriver = new AnalysisDriver(taskManager, context);
1755 } 1755 }
1756 1756
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1802 return entryMap.putIfAbsent(target, () => new CacheEntry()); 1802 return entryMap.putIfAbsent(target, () => new CacheEntry());
1803 } 1803 }
1804 1804
1805 TimestampedData<String> getContents(Source source) => source.contents; 1805 TimestampedData<String> getContents(Source source) => source.contents;
1806 1806
1807 noSuchMethod(Invocation invocation) { 1807 noSuchMethod(Invocation invocation) {
1808 print('noSuchMethod: ${invocation.memberName}'); 1808 print('noSuchMethod: ${invocation.memberName}');
1809 return super.noSuchMethod(invocation); 1809 return super.noSuchMethod(invocation);
1810 } 1810 }
1811 } 1811 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698