| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // setter | 236 // setter |
| 237 field = 2; // ref-nq; | 237 field = 2; // ref-nq; |
| 238 this.field = 3; // ref-q; | 238 this.field = 3; // ref-q; |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 '''); | 241 '''); |
| 242 FieldElement element = findElement('field'); | 242 FieldElement element = findElement('field'); |
| 243 Element main = findElement('main'); | 243 Element main = findElement('main'); |
| 244 Element fieldParameter = findElement('field', ElementKind.PARAMETER); | 244 Element fieldParameter = findElement('field', ElementKind.PARAMETER); |
| 245 var expected = [ | 245 var expected = [ |
| 246 _expectId(fieldParameter, MatchKind.REFERENCE, 'field}'), | 246 _expectId(fieldParameter, MatchKind.WRITE, 'field}'), |
| 247 _expectId(main, MatchKind.REFERENCE, 'field: 1'), | 247 _expectId(main, MatchKind.REFERENCE, 'field: 1'), |
| 248 _expectId(main, MatchKind.READ, 'field); // ref-nq'), | 248 _expectId(main, MatchKind.READ, 'field); // ref-nq'), |
| 249 _expectIdQ(main, MatchKind.READ, 'field); // ref-q'), | 249 _expectIdQ(main, MatchKind.READ, 'field); // ref-q'), |
| 250 _expectId(main, MatchKind.INVOCATION, 'field(); // inv-nq'), | 250 _expectId(main, MatchKind.INVOCATION, 'field(); // inv-nq'), |
| 251 _expectIdQ(main, MatchKind.INVOCATION, 'field(); // inv-q'), | 251 _expectIdQ(main, MatchKind.INVOCATION, 'field(); // inv-q'), |
| 252 _expectId(main, MatchKind.WRITE, 'field = 2; // ref-nq'), | 252 _expectId(main, MatchKind.WRITE, 'field = 2; // ref-nq'), |
| 253 _expectIdQ(main, MatchKind.WRITE, 'field = 3; // ref-q'),]; | 253 _expectIdQ(main, MatchKind.WRITE, 'field = 3; // ref-q'),]; |
| 254 return _verifyReferences(element, expected); | 254 return _verifyReferences(element, expected); |
| 255 } | 255 } |
| 256 | 256 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 pattern).then((List<SearchMatch> matches) { | 638 pattern).then((List<SearchMatch> matches) { |
| 639 _assertMatches(matches, expectedMatches); | 639 _assertMatches(matches, expectedMatches); |
| 640 }); | 640 }); |
| 641 } | 641 } |
| 642 | 642 |
| 643 static void _assertMatches(List<SearchMatch> matches, | 643 static void _assertMatches(List<SearchMatch> matches, |
| 644 List<ExpectedMatch> expectedMatches) { | 644 List<ExpectedMatch> expectedMatches) { |
| 645 expect(matches, unorderedEquals(expectedMatches)); | 645 expect(matches, unorderedEquals(expectedMatches)); |
| 646 } | 646 } |
| 647 } | 647 } |
| OLD | NEW |