OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.services.src.index.dart_index_contributor; | 5 library test.services.src.index.dart_index_contributor; |
6 | 6 |
7 import 'package:analysis_server/src/services/index/index.dart'; | 7 import 'package:analysis_server/src/services/index/index.dart'; |
8 import 'package:analysis_server/src/services/index/index_contributor.dart'; | 8 import 'package:analysis_server/src/services/index/index_contributor.dart'; |
9 import 'package:analysis_server/src/services/index/index_store.dart'; | 9 import 'package:analysis_server/src/services/index/index_store.dart'; |
10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 Element expectedElement, Relationship expectedRelationship, | 54 Element expectedElement, Relationship expectedRelationship, |
55 ExpectedLocation expectedLocation) { | 55 ExpectedLocation expectedLocation) { |
56 return expectedElement == recordedRelation.element && | 56 return expectedElement == recordedRelation.element && |
57 (expectedRelationship == null || | 57 (expectedRelationship == null || |
58 expectedRelationship == recordedRelation.relationship) && | 58 expectedRelationship == recordedRelation.relationship) && |
59 (expectedLocation == null || | 59 (expectedLocation == null || |
60 _equalsLocation(recordedRelation.location, expectedLocation)); | 60 _equalsLocation(recordedRelation.location, expectedLocation)); |
61 } | 61 } |
62 | 62 |
63 | 63 |
64 @ReflectiveTestCase() | 64 @reflectiveTest |
65 class DartUnitContributorTest extends AbstractSingleUnitTest { | 65 class DartUnitContributorTest extends AbstractSingleUnitTest { |
66 IndexStore store = new MockIndexStore(); | 66 IndexStore store = new MockIndexStore(); |
67 List<RecordedRelation> recordedRelations = <RecordedRelation>[]; | 67 List<RecordedRelation> recordedRelations = <RecordedRelation>[]; |
68 | 68 |
69 CompilationUnitElement importedUnit({int index: 0}) { | 69 CompilationUnitElement importedUnit({int index: 0}) { |
70 List<ImportElement> imports = testLibraryElement.imports; | 70 List<ImportElement> imports = testLibraryElement.imports; |
71 return imports[index].importedLibrary.definingCompilationUnit; | 71 return imports[index].importedLibrary.definingCompilationUnit; |
72 } | 72 } |
73 | 73 |
74 void setUp() { | 74 void setUp() { |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1781 | 1781 |
1782 RecordedRelation(this.element, this.relationship, this.location); | 1782 RecordedRelation(this.element, this.relationship, this.location); |
1783 | 1783 |
1784 @override | 1784 @override |
1785 String toString() { | 1785 String toString() { |
1786 return 'RecordedRelation(element=$element; relationship=$relationship; ' | 1786 return 'RecordedRelation(element=$element; relationship=$relationship; ' |
1787 'location=$location; flags=' '${location.isQualified ? "Q" : ""}' | 1787 'location=$location; flags=' '${location.isQualified ? "Q" : ""}' |
1788 '${location.isResolved ? "R" : ""})'; | 1788 '${location.isResolved ? "R" : ""})'; |
1789 } | 1789 } |
1790 } | 1790 } |
OLD | NEW |