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_engine2; | 5 library test.services.src.search.search_engine2; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/services/index2/index2.dart'; | 9 import 'package:analysis_server/src/services/index2/index2.dart'; |
10 import 'package:analysis_server/src/services/search/search_engine.dart'; | 10 import 'package:analysis_server/src/services/search/search_engine.dart'; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 @reflectiveTest | 65 @reflectiveTest |
66 class SearchEngineImpl2Test extends AbstractSingleUnitTest { | 66 class SearchEngineImpl2Test extends AbstractSingleUnitTest { |
67 Index2 index; | 67 Index2 index; |
68 SearchEngineImpl2 searchEngine; | 68 SearchEngineImpl2 searchEngine; |
69 | 69 |
70 void setUp() { | 70 void setUp() { |
71 super.setUp(); | 71 super.setUp(); |
72 index = createMemoryIndex2(); | 72 index = createMemoryIndex2(); |
73 searchEngine = new SearchEngineImpl2(context, index); | 73 searchEngine = new SearchEngineImpl2(index); |
74 } | 74 } |
75 | 75 |
76 test_searchAllSubtypes() async { | 76 test_searchAllSubtypes() async { |
77 _indexTestUnit(''' | 77 _indexTestUnit(''' |
78 class T {} | 78 class T {} |
79 class A extends T {} | 79 class A extends T {} |
80 class B extends A {} | 80 class B extends A {} |
81 class C implements B {} | 81 class C implements B {} |
82 '''); | 82 '''); |
83 ClassElement element = findElement('T'); | 83 ClassElement element = findElement('T'); |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 Element element, List<ExpectedMatch> expectedMatches) async { | 705 Element element, List<ExpectedMatch> expectedMatches) async { |
706 List<SearchMatch> matches = await searchEngine.searchReferences(element); | 706 List<SearchMatch> matches = await searchEngine.searchReferences(element); |
707 _assertMatches(matches, expectedMatches); | 707 _assertMatches(matches, expectedMatches); |
708 } | 708 } |
709 | 709 |
710 static void _assertMatches( | 710 static void _assertMatches( |
711 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { | 711 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { |
712 expect(matches, unorderedEquals(expectedMatches)); | 712 expect(matches, unorderedEquals(expectedMatches)); |
713 } | 713 } |
714 } | 714 } |
OLD | NEW |