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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // var expected = [ | 87 // var expected = [ |
88 // _expectId(elementA, MatchKind.DECLARATION, 'A extends T'), | 88 // _expectId(elementA, MatchKind.DECLARATION, 'A extends T'), |
89 // _expectId(elementB, MatchKind.DECLARATION, 'B extends A'), | 89 // _expectId(elementB, MatchKind.DECLARATION, 'B extends A'), |
90 // _expectId(elementC, MatchKind.DECLARATION, 'C implements B') | 90 // _expectId(elementC, MatchKind.DECLARATION, 'C implements B') |
91 // ]; | 91 // ]; |
92 // return searchEngine.searchAllSubtypes(element).then((matches) { | 92 // return searchEngine.searchAllSubtypes(element).then((matches) { |
93 // _assertMatches(matches, expected); | 93 // _assertMatches(matches, expected); |
94 // }); | 94 // }); |
95 // } | 95 // } |
96 // | 96 // |
97 // Future test_searchElementDeclarations() { | |
98 // _indexTestUnit(''' | |
99 //class A { | |
100 // test() {} | |
101 //} | |
102 //class B { | |
103 // int test = 1; | |
104 // main() { | |
105 // int test = 2; | |
106 // } | |
107 //} | |
108 //'''); | |
109 // ClassElement elementA = findElement('A'); | |
110 // ClassElement elementB = findElement('B'); | |
111 // Element element_test = findElement('test', ElementKind.LOCAL_VARIABLE); | |
112 // var expected = [ | |
113 // _expectId(elementA.methods[0], MatchKind.DECLARATION, 'test() {}'), | |
114 // _expectId(elementB.fields[0], MatchKind.DECLARATION, 'test = 1;'), | |
115 // _expectId(element_test, MatchKind.DECLARATION, 'test = 2;'), | |
116 // ]; | |
117 // return searchEngine.searchElementDeclarations('test').then((matches) { | |
118 // _assertMatches(matches, expected); | |
119 // }); | |
120 // } | |
121 // | |
122 // Future test_searchMemberDeclarations() { | 97 // Future test_searchMemberDeclarations() { |
123 // _indexTestUnit(''' | 98 // _indexTestUnit(''' |
124 //class A { | 99 //class A { |
125 // test() {} | 100 // test() {} |
126 //} | 101 //} |
127 //class B { | 102 //class B { |
128 // int test = 1; | 103 // int test = 1; |
129 // main() { | 104 // main() { |
130 // int test = 2; | 105 // int test = 2; |
131 // } | 106 // } |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 // .then((List<SearchMatch> matches) { | 723 // .then((List<SearchMatch> matches) { |
749 // _assertMatches(matches, expectedMatches); | 724 // _assertMatches(matches, expectedMatches); |
750 // }); | 725 // }); |
751 // } | 726 // } |
752 | 727 |
753 static void _assertMatches( | 728 static void _assertMatches( |
754 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { | 729 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { |
755 expect(matches, unorderedEquals(expectedMatches)); | 730 expect(matches, unorderedEquals(expectedMatches)); |
756 } | 731 } |
757 } | 732 } |
OLD | NEW |