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

Unified Diff: pkg/analysis_server/test/analysis_notification_occurrences_test.dart

Issue 438753002: Ignore 'dynamic' and 'void' elements in the occurrences computer too. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/analysis_server/test/analysis_notification_navigation_test.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/analysis_notification_occurrences_test.dart
diff --git a/pkg/analysis_server/test/analysis_notification_occurrences_test.dart b/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
index 8507050937490b58d9ea3152966316b0bf868da2..3f2ed6a7505502d20168bb3b751bf5b97f74bda1 100644
--- a/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
+++ b/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
@@ -125,26 +125,6 @@ main() {
});
}
- test_classType() {
- addTestFile('''
-main() {
- int a = 1;
- int b = 2;
- int c = 3;
-}
-int VVV = 4;
-''');
- return prepareOccurrences().then((_) {
- assertHasRegion('int a');
- expect(testOccurences.element.kind, ElementKind.CLASS);
- expect(testOccurences.element.name, 'int');
- assertHasOffset('int a');
- assertHasOffset('int b');
- assertHasOffset('int c');
- assertHasOffset('int VVV');
- });
- }
-
test_field() {
addTestFile('''
class A {
@@ -238,4 +218,49 @@ main() {
assertHasOffset('VVV);');
});
}
+
+ test_type_class() {
+ addTestFile('''
+main() {
+ int a = 1;
+ int b = 2;
+ int c = 3;
+}
+int VVV = 4;
+''');
+ return prepareOccurrences().then((_) {
+ assertHasRegion('int a');
+ expect(testOccurences.element.kind, ElementKind.CLASS);
+ expect(testOccurences.element.name, 'int');
+ assertHasOffset('int a');
+ assertHasOffset('int b');
+ assertHasOffset('int c');
+ assertHasOffset('int VVV');
+ });
+ }
+
+ test_type_dynamic() {
+ addTestFile('''
+main() {
+ dynamic a = 1;
+ dynamic b = 2;
+}
+dynamic V = 3;
+''');
+ return prepareOccurrences().then((_) {
+ int offset = findOffset('dynamic a');
+ findRegion(offset, 'dynamic'.length, false);
+ });
+ }
+
+ test_type_void() {
+ addTestFile('''
+void main() {
+}
+''');
+ return prepareOccurrences().then((_) {
+ int offset = findOffset('void main()');
+ findRegion(offset, 'void'.length, false);
+ });
+ }
}
« no previous file with comments | « pkg/analysis_server/test/analysis_notification_navigation_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698