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

Unified Diff: pkg/analyzer/test/src/dart/element/element_test.dart

Issue 2971893002: Remove other usages of ExecutableElement.localVariables. (Closed)
Patch Set: Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/src/dart/analysis/search_test.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/dart/element/element_test.dart
diff --git a/pkg/analyzer/test/src/dart/element/element_test.dart b/pkg/analyzer/test/src/dart/element/element_test.dart
index 2eef5fdeb509d13572eeda0e9d19c09e0152f8b0..083c8be8382873e7db756ce34e3de9f4c8ff4396 100644
--- a/pkg/analyzer/test/src/dart/element/element_test.dart
+++ b/pkg/analyzer/test/src/dart/element/element_test.dart
@@ -3836,43 +3836,7 @@ class LibraryElementImplTest extends EngineTestCase {
}
@reflectiveTest
-class LocalVariableElementImplTest extends EngineTestCase {
- void test_computeNode_declaredIdentifier() {
- AnalysisContextHelper contextHelper = new AnalysisContextHelper();
- AnalysisContext context = contextHelper.context;
- Source source = contextHelper.addSource(
- "/test.dart",
- r'''
-main() {
- for (int v in <int>[1, 2, 3]) {}
-}''');
- LibraryElement libraryElement = context.computeLibraryElement(source);
- FunctionElement mainElement = libraryElement.units[0].functions[0];
- LocalVariableElement element = mainElement.localVariables[0];
- DeclaredIdentifier node = element.computeNode() as DeclaredIdentifier;
- expect(node, isNotNull);
- expect(node.identifier.name, 'v');
- expect(node.element, same(element));
- }
-
- void test_computeNode_variableDeclaration() {
- AnalysisContextHelper contextHelper = new AnalysisContextHelper();
- AnalysisContext context = contextHelper.context;
- Source source = contextHelper.addSource(
- "/test.dart",
- r'''
-main() {
- int v = 0;
-}''');
- LibraryElement libraryElement = context.computeLibraryElement(source);
- FunctionElement mainElement = libraryElement.units[0].functions[0];
- LocalVariableElement element = mainElement.localVariables[0];
- VariableDeclaration node = element.computeNode() as VariableDeclaration;
- expect(node, isNotNull);
- expect(node.name.name, 'v');
- expect(node.element, same(element));
- }
-}
+class LocalVariableElementImplTest extends EngineTestCase {}
@reflectiveTest
class MethodElementImplTest extends EngineTestCase {
« no previous file with comments | « pkg/analyzer/test/src/dart/analysis/search_test.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698