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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 print(field); // ref-nq | 280 print(field); // ref-nq |
281 print(this.field); // ref-q | 281 print(this.field); // ref-q |
282 field(); // inv-nq | 282 field(); // inv-nq |
283 this.field(); // inv-q | 283 this.field(); // inv-q |
284 // setter | 284 // setter |
285 field = 2; // ref-nq; | 285 field = 2; // ref-nq; |
286 this.field = 3; // ref-q; | 286 this.field = 3; // ref-q; |
287 } | 287 } |
288 } | 288 } |
289 '''); | 289 '''); |
290 FieldElement element = findElement('field'); | 290 FieldElement element = findElement('field', ElementKind.FIELD); |
291 Element main = findElement('main'); | 291 Element main = findElement('main'); |
292 Element fieldParameter = findElement('field', ElementKind.PARAMETER); | 292 Element fieldParameter = findElement('field', ElementKind.PARAMETER); |
293 var expected = [ | 293 var expected = [ |
294 _expectIdQ(fieldParameter, MatchKind.WRITE, 'field}'), | 294 _expectIdQ(fieldParameter, MatchKind.WRITE, 'field}'), |
295 _expectIdQ(main, MatchKind.REFERENCE, 'field: 1'), | 295 _expectIdQ(main, MatchKind.REFERENCE, 'field: 1'), |
296 _expectId(main, MatchKind.READ, 'field); // ref-nq'), | 296 _expectId(main, MatchKind.READ, 'field); // ref-nq'), |
297 _expectIdQ(main, MatchKind.READ, 'field); // ref-q'), | 297 _expectIdQ(main, MatchKind.READ, 'field); // ref-q'), |
298 _expectId(main, MatchKind.INVOCATION, 'field(); // inv-nq'), | 298 _expectId(main, MatchKind.INVOCATION, 'field(); // inv-nq'), |
299 _expectIdQ(main, MatchKind.INVOCATION, 'field(); // inv-q'), | 299 _expectIdQ(main, MatchKind.INVOCATION, 'field(); // inv-q'), |
300 _expectId(main, MatchKind.WRITE, 'field = 2; // ref-nq'), | 300 _expectId(main, MatchKind.WRITE, 'field = 2; // ref-nq'), |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 List<SearchMatch> matches = await searchEngine.searchReferences(element); | 899 List<SearchMatch> matches = await searchEngine.searchReferences(element); |
900 _assertMatches(matches, expectedMatches); | 900 _assertMatches(matches, expectedMatches); |
901 expect(matches, hasLength(expectedMatches.length)); | 901 expect(matches, hasLength(expectedMatches.length)); |
902 } | 902 } |
903 | 903 |
904 static void _assertMatches( | 904 static void _assertMatches( |
905 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { | 905 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { |
906 expect(matches, unorderedEquals(expectedMatches)); | 906 expect(matches, unorderedEquals(expectedMatches)); |
907 } | 907 } |
908 } | 908 } |
OLD | NEW |