| 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_internal; | 5 library test.services.src.search.search_engine_internal; |
| 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/search/search_engine.dart'; | 10 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 buffer.write(")"); | 62 buffer.write(")"); |
| 63 return buffer.toString(); | 63 return buffer.toString(); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 @reflectiveTest | 67 @reflectiveTest |
| 68 class SearchEngineImplTest extends AbstractSingleUnitTest { | 68 class SearchEngineImplTest extends AbstractSingleUnitTest { |
| 69 Index index; | 69 Index index; |
| 70 SearchEngineImpl searchEngine; | 70 SearchEngineImpl searchEngine; |
| 71 | 71 |
| 72 @override |
| 73 bool get enableNewAnalysisDriver => false; |
| 74 |
| 72 void setUp() { | 75 void setUp() { |
| 73 super.setUp(); | 76 super.setUp(); |
| 74 index = createMemoryIndex(); | 77 index = createMemoryIndex(); |
| 75 searchEngine = | 78 searchEngine = |
| 76 new SearchEngineImpl(index, (_) => new AstProviderForContext(context)); | 79 new SearchEngineImpl(index, (_) => new AstProviderForContext(context)); |
| 77 } | 80 } |
| 78 | 81 |
| 79 test_searchAllSubtypes() async { | 82 test_searchAllSubtypes() async { |
| 80 await _indexTestUnit(''' | 83 await _indexTestUnit(''' |
| 81 class T {} | 84 class T {} |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 List<SearchMatch> matches = await searchEngine.searchReferences(element); | 947 List<SearchMatch> matches = await searchEngine.searchReferences(element); |
| 945 _assertMatches(matches, expectedMatches); | 948 _assertMatches(matches, expectedMatches); |
| 946 expect(matches, hasLength(expectedMatches.length)); | 949 expect(matches, hasLength(expectedMatches.length)); |
| 947 } | 950 } |
| 948 | 951 |
| 949 static void _assertMatches( | 952 static void _assertMatches( |
| 950 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { | 953 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { |
| 951 expect(matches, unorderedEquals(expectedMatches)); | 954 expect(matches, unorderedEquals(expectedMatches)); |
| 952 } | 955 } |
| 953 } | 956 } |
| OLD | NEW |