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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1467363002: Skip local variable dependepcies. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 41f9c0c3c7b341822724269d30033c49fc9712e5..b73eeae57c51c739471bd2e94fbe15f7fb5970de 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -1833,6 +1833,32 @@ var d4 = 4;
getTopLevelVariableElement(unit, 'd2')
]));
}
+
+ test_perform_topLevel_ignoreLocal() {
+ AnalysisTarget source = newSource(
+ '/test.dart',
+ '''
+final a = () {
+ const b = 2;
+ const c = 3;
+ return b + c;
+}() + d;
+final d = 4;
+''');
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
+ computeResult(target, RESOLVED_UNIT5);
+ CompilationUnit unit = outputs[RESOLVED_UNIT5];
+ TopLevelVariableElement elementA = getTopLevelVariableElement(unit, 'a');
+ // compute
+ computeResult(elementA, PROPAGABLE_VARIABLE_DEPENDENCIES,
+ matcher: isComputePropagableVariableDependenciesTask);
+ // verify
+ expect(outputs, hasLength(1));
+ List<VariableElement> dependencies =
+ outputs[PROPAGABLE_VARIABLE_DEPENDENCIES];
+ expect(
+ dependencies, unorderedEquals([getTopLevelVariableElement(unit, 'd')]));
+ }
}
@reflectiveTest
« 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