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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return buffer.toString(); | 61 return buffer.toString(); |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 | 65 |
66 class MockIndex extends TypedMock implements Index { | 66 class MockIndex extends TypedMock implements Index { |
67 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 67 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
68 } | 68 } |
69 | 69 |
70 | 70 |
71 @ReflectiveTestCase() | 71 @reflectiveTest |
72 class SearchEngineImplTest extends AbstractSingleUnitTest { | 72 class SearchEngineImplTest extends AbstractSingleUnitTest { |
73 Index index; | 73 Index index; |
74 SearchEngineImpl searchEngine; | 74 SearchEngineImpl searchEngine; |
75 | 75 |
76 void setUp() { | 76 void setUp() { |
77 super.setUp(); | 77 super.setUp(); |
78 index = createLocalMemoryIndex(); | 78 index = createLocalMemoryIndex(); |
79 searchEngine = new SearchEngineImpl(index); | 79 searchEngine = new SearchEngineImpl(index); |
80 } | 80 } |
81 | 81 |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 pattern).then((List<SearchMatch> matches) { | 640 pattern).then((List<SearchMatch> matches) { |
641 _assertMatches(matches, expectedMatches); | 641 _assertMatches(matches, expectedMatches); |
642 }); | 642 }); |
643 } | 643 } |
644 | 644 |
645 static void _assertMatches(List<SearchMatch> matches, | 645 static void _assertMatches(List<SearchMatch> matches, |
646 List<ExpectedMatch> expectedMatches) { | 646 List<ExpectedMatch> expectedMatches) { |
647 expect(matches, unorderedEquals(expectedMatches)); | 647 expect(matches, unorderedEquals(expectedMatches)); |
648 } | 648 } |
649 } | 649 } |
OLD | NEW |