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

Unified Diff: pkg/analysis_services/test/index/dart_index_contributor_test.dart

Issue 402333006: Implementation of the 'edit.getFixes' API in server. (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
Index: pkg/analysis_services/test/index/dart_index_contributor_test.dart
diff --git a/pkg/analysis_services/test/index/dart_index_contributor_test.dart b/pkg/analysis_services/test/index/dart_index_contributor_test.dart
index 991245978e097c4caaf1b7c296c916f07b36b793..f6d7e201537475fbb87311bcb919c25924771dab 100644
--- a/pkg/analysis_services/test/index/dart_index_contributor_test.dart
+++ b/pkg/analysis_services/test/index/dart_index_contributor_test.dart
@@ -7,6 +7,7 @@ library test.services.src.index.dart_index_contributor;
import 'package:analysis_services/index/index.dart';
import 'package:analysis_services/index/index_store.dart';
import 'package:analysis_services/src/index/index_contributor.dart';
+import 'package:analysis_testing/abstract_single_unit.dart';
import 'package:analysis_testing/reflective_tests.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
@@ -14,8 +15,6 @@ import 'package:analyzer/src/generated/source.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
-import 'abstract_single_unit.dart';
-
main() {
groupSep = ' | ';
@@ -123,6 +122,26 @@ main(A a, p) {
_expectedLocation(mainElement, 'field); // not a member'));
}
+ void test_NameElement_isDefinedBy_localVariable_inForEach() {
+ _indexTestUnit('''
+class A {
+ main() {
+ for (int test in []) {
+ }
+ }
+}
+''');
+ // prepare elements
+ Element mainElement = findElement('main');
+ LocalVariableElement testElement = findElement('test');
+ Element nameElement = new NameElement('test');
+ // verify
+ _assertRecordedRelation(
+ nameElement,
+ IndexConstants.NAME_IS_DEFINED_BY,
+ _expectedLocation(testElement, 'test in []'));
+ }
+
void test_NameElement_method() {
_indexTestUnit('''
class A {
@@ -152,26 +171,6 @@ main(A a, p) {
_expectedLocationQU(mainElement, 'method(); // ur'));
}
- void test_NameElement_isDefinedBy_localVariable_inForEach() {
- _indexTestUnit('''
-class A {
- main() {
- for (int test in []) {
- }
- }
-}
-''');
- // prepare elements
- Element mainElement = findElement('main');
- LocalVariableElement testElement = findElement('test');
- Element nameElement = new NameElement('test');
- // verify
- _assertRecordedRelation(
- nameElement,
- IndexConstants.NAME_IS_DEFINED_BY,
- _expectedLocation(testElement, 'test in []'));
- }
-
void test_NameElement_operator_resolved() {
_indexTestUnit('''
class A {

Powered by Google App Engine
This is Rietveld 408576698