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

Unified Diff: pkg/analysis_server/test/services/search/search_engine_test.dart

Issue 1802023002: Fix for searching parameters of constructors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/analysis_server/lib/src/services/search/search_engine_internal.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/search/search_engine_test.dart
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index 8747bbeb25ed6a14fcbd626a7ba25578d441bd9e..70caeff009cd82cbfe76b4910190cd68455d142e 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -565,6 +565,36 @@ main(A<int> a) {
await _verifyReferences(method, expected);
}
+ test_searchReferences_ParameterElement_ofConstructor() async {
+ _indexTestUnit('''
+class C {
+ var f;
+ C({p}) : f = p + 1 {
+ p = 2;
+ p += 3;
+ print(p);
+ p();
+ }
+}
+main() {
+ new C(p: 42);
+}
+''');
+ ParameterElement element = findElement('p');
+ ClassElement classC = findElement('C');
+ ConstructorElement constructorA = classC.unnamedConstructor;
+ Element mainElement = findElement('main');
+ var expected = [
+ _expectId(constructorA, MatchKind.READ, 'p + 1 {'),
+ _expectId(constructorA, MatchKind.WRITE, 'p = 2;'),
+ _expectId(constructorA, MatchKind.READ_WRITE, 'p += 3;'),
+ _expectId(constructorA, MatchKind.READ, 'p);'),
+ _expectId(constructorA, MatchKind.INVOCATION, 'p();'),
+ _expectIdQ(mainElement, MatchKind.REFERENCE, 'p: 42')
+ ];
+ await _verifyReferences(element, expected);
+ }
+
test_searchReferences_ParameterElement_ofLocalFunction() async {
_indexTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/search/search_engine_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698