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

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

Issue 1484713002: Issue 25030. Fix for searching variable declaration when there is no whitespace after the type. (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 8b2bae5512988c865be34a2c9c0ec83df0b11018..078592132e5f31acc5a94d2a520f0d808399916b 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -1859,6 +1859,33 @@ final d = 4;
expect(
dependencies, unorderedEquals([getTopLevelVariableElement(unit, 'd')]));
}
+
+ test_perform_topLevel_withoutSpaceAfterType() {
+ AnalysisTarget source = newSource(
+ '/test.dart',
+ '''
+const List<int>a=[b, c];
+const b = 1;
+const c = 2;
+''');
+ 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, 'b'),
+ getTopLevelVariableElement(unit, 'c')
+ ]));
+ }
}
@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