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

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

Issue 2068123003: Skip class method type parameters and formal parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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/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 31c8519929e8e9fb07155bd1ade83010952d85cb..89cbfbca35ae2545761317439e5b58bda6bce8e5 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -4042,6 +4042,43 @@ class U {
expect(info.userToDependsOn['U'], unorderedEquals(['A']));
}
+ test_referencedNames_class_members() {
+ ReferencedNames info = _computeReferencedNames('''
+class U {
+ int a;
+ int get b;
+ set c(_) {}
+ m(D d) {
+ a;
+ b;
+ c = 1;
+ m();
+ }
+}
+''');
+ expect(info.names, unorderedEquals(['int', 'D']));
+ expect(info.userToDependsOn.keys, unorderedEquals(['U']));
+ expect(info.userToDependsOn['U'], unorderedEquals(['int', 'D']));
+ }
+
+ test_referencedNames_class_members_dontHideQualified() {
+ ReferencedNames info = _computeReferencedNames('''
+class U {
+ int a;
+ int get b;
+ set c(_) {}
+ m(D d) {
+ d.a;
+ d.b;
+ d.c;
+ }
+}
+''');
+ expect(info.names, unorderedEquals(['int', 'D', 'a', 'b', 'c']));
+ expect(info.userToDependsOn.keys, unorderedEquals(['U']));
+ expect(info.userToDependsOn['U'], unorderedEquals(['int', 'D']));
+ }
+
test_referencedNames_class_method() {
ReferencedNames info = _computeReferencedNames('''
class U {
@@ -4055,6 +4092,53 @@ class U {
expect(info.userToDependsOn['U'], unorderedEquals(['A', 'B']));
}
+ test_referencedNames_class_method_localVariables() {
+ ReferencedNames info = _computeReferencedNames('''
+class U {
+ A m() {
+ B b = null;
+ b;
+ {
+ C c = null;
+ b;
+ c;
+ }
+ d;
+ }
+}
+''');
+ expect(info.names, unorderedEquals(['A', 'B', 'C', 'd']));
+ expect(info.userToDependsOn.keys, unorderedEquals(['U']));
+ expect(info.userToDependsOn['U'], unorderedEquals(['A']));
+ }
+
+ test_referencedNames_class_method_parameters() {
+ ReferencedNames info = _computeReferencedNames('''
+class U {
+ m(A a) {
+ a;
+ b;
+ }
+}
+''');
+ expect(info.names, unorderedEquals(['A', 'b']));
+ expect(info.userToDependsOn.keys, unorderedEquals(['U']));
+ expect(info.userToDependsOn['U'], unorderedEquals(['A']));
+ }
+
+ test_referencedNames_class_method_typeParameters() {
+ ReferencedNames info = _computeReferencedNames('''
+class U {
+ A m<T>(B b, T t) {
+ C c = 0;
+ }
+}
+''');
+ expect(info.names, unorderedEquals(['A', 'B', 'C']));
+ expect(info.userToDependsOn.keys, unorderedEquals(['U']));
+ expect(info.userToDependsOn['U'], unorderedEquals(['A', 'B']));
+ }
+
test_referencedNames_class_setter() {
ReferencedNames info = _computeReferencedNames('''
class U {
« 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