| 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.search.search_engine; | 5 library test.services.src.search.search_engine; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/services/index/index.dart'; | 9 import 'package:analysis_server/src/services/index/index.dart'; |
| 10 import 'package:analysis_server/src/services/index/local_memory_index.dart'; | 10 import 'package:analysis_server/src/services/index/local_memory_index.dart'; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 Future test_searchReferences_ConstructorElement() { | 204 Future test_searchReferences_ConstructorElement() { |
| 205 _indexTestUnit(''' | 205 _indexTestUnit(''' |
| 206 class A { | 206 class A { |
| 207 A.named() {} | 207 A.named() {} |
| 208 } | 208 } |
| 209 main() { | 209 main() { |
| 210 new A.named(); | 210 new A.named(); |
| 211 } | 211 } |
| 212 '''); | 212 '''); |
| 213 ConstructorElement element = findElement('named'); | 213 ConstructorElement element = findElement('named'); |
| 214 ClassElement elementA = findElement('A'); | |
| 215 Element mainElement = findElement('main'); | 214 Element mainElement = findElement('main'); |
| 216 var expected = [ | 215 var expected = [ |
| 217 _expectId(elementA, MatchKind.DECLARATION, '.named() {}', length: 6), | |
| 218 _expectId(mainElement, MatchKind.REFERENCE, '.named();', length: 6)]; | 216 _expectId(mainElement, MatchKind.REFERENCE, '.named();', length: 6)]; |
| 219 return _verifyReferences(element, expected); | 217 return _verifyReferences(element, expected); |
| 220 } | 218 } |
| 221 | 219 |
| 222 Future test_searchReferences_Element_unknown() { | 220 Future test_searchReferences_Element_unknown() { |
| 223 return _verifyReferences(UniverseElement.INSTANCE, []); | 221 return _verifyReferences(UniverseElement.INSTANCE, []); |
| 224 } | 222 } |
| 225 | 223 |
| 226 Future test_searchReferences_FieldElement() { | 224 Future test_searchReferences_FieldElement() { |
| 227 _indexTestUnit(''' | 225 _indexTestUnit(''' |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 pattern).then((List<SearchMatch> matches) { | 638 pattern).then((List<SearchMatch> matches) { |
| 641 _assertMatches(matches, expectedMatches); | 639 _assertMatches(matches, expectedMatches); |
| 642 }); | 640 }); |
| 643 } | 641 } |
| 644 | 642 |
| 645 static void _assertMatches(List<SearchMatch> matches, | 643 static void _assertMatches(List<SearchMatch> matches, |
| 646 List<ExpectedMatch> expectedMatches) { | 644 List<ExpectedMatch> expectedMatches) { |
| 647 expect(matches, unorderedEquals(expectedMatches)); | 645 expect(matches, unorderedEquals(expectedMatches)); |
| 648 } | 646 } |
| 649 } | 647 } |
| OLD | NEW |