| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 buffer.write(range); | 55 buffer.write(range); |
| 56 buffer.write(", isResolved="); | 56 buffer.write(", isResolved="); |
| 57 buffer.write(isResolved); | 57 buffer.write(isResolved); |
| 58 buffer.write(", isQualified="); | 58 buffer.write(", isQualified="); |
| 59 buffer.write(isQualified); | 59 buffer.write(isQualified); |
| 60 buffer.write(")"); | 60 buffer.write(")"); |
| 61 return buffer.toString(); | 61 return buffer.toString(); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 class MockIndex extends TypedMock implements Index { | 65 class MockIndex extends TypedMock implements Index {} |
| 66 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | |
| 67 } | |
| 68 | 66 |
| 69 @reflectiveTest | 67 @reflectiveTest |
| 70 class SearchEngineImplTest extends AbstractSingleUnitTest { | 68 class SearchEngineImplTest extends AbstractSingleUnitTest { |
| 71 Index index; | 69 Index index; |
| 72 SearchEngineImpl searchEngine; | 70 SearchEngineImpl searchEngine; |
| 73 | 71 |
| 74 void setUp() { | 72 void setUp() { |
| 75 super.setUp(); | 73 super.setUp(); |
| 76 index = createLocalMemoryIndex(); | 74 index = createLocalMemoryIndex(); |
| 77 searchEngine = new SearchEngineImpl(index); | 75 searchEngine = new SearchEngineImpl(index); |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 .then((List<SearchMatch> matches) { | 666 .then((List<SearchMatch> matches) { |
| 669 _assertMatches(matches, expectedMatches); | 667 _assertMatches(matches, expectedMatches); |
| 670 }); | 668 }); |
| 671 } | 669 } |
| 672 | 670 |
| 673 static void _assertMatches( | 671 static void _assertMatches( |
| 674 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { | 672 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { |
| 675 expect(matches, unorderedEquals(expectedMatches)); | 673 expect(matches, unorderedEquals(expectedMatches)); |
| 676 } | 674 } |
| 677 } | 675 } |
| OLD | NEW |