Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1060)

Side by Side Diff: pkg/analysis_server/test/search/element_references_test.dart

Issue 1801883002: Remove old index and search implementations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.search.element_references; 5 library test.search.element_references;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; 9 import 'package:analysis_server/plugin/protocol/protocol.dart';
10 import 'package:analysis_server/src/services/index/index.dart'; 10 import 'package:analysis_server/src/services/index/index.dart';
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 test_file_libraryUnit_atImportDirective() async { 226 test_file_libraryUnit_atImportDirective() async {
227 String fileLib = '$testFolder/my_lib.dart'; 227 String fileLib = '$testFolder/my_lib.dart';
228 String fileUser = '$testFolder/userA.dart'; 228 String fileUser = '$testFolder/userA.dart';
229 String codeUser = "import 'my_lib.dart'; // U"; 229 String codeUser = "import 'my_lib.dart'; // U";
230 addFile(fileLib, 'library my.lib;'); 230 addFile(fileLib, 'library my.lib;');
231 addFile(fileUser, codeUser); 231 addFile(fileUser, codeUser);
232 addTestFile(''' 232 addTestFile('''
233 import 'my_lib.dart'; // T 233 import 'my_lib.dart'; // T
234 '''); 234 ''');
235 await findElementReferences('import ', false); 235 await findElementReferences('import ', false);
236 expect(searchElement.kind, ElementKind.FILE); 236 // expect(searchElement.kind, ElementKind.FILE);
Brian Wilkerson 2016/03/14 18:57:32 Remove this?
237 expect(searchElement.kind, ElementKind.LIBRARY);
237 expect(results, hasLength(2)); 238 expect(results, hasLength(2));
238 // in U 239 // in U
239 { 240 {
240 SearchResult result = results.singleWhere((result) { 241 SearchResult result = results.singleWhere((result) {
241 return result.location.file == fileUser; 242 return result.location.file == fileUser;
242 }); 243 });
243 expect(result.location.offset, codeUser.indexOf("'my_lib.dart'; // U")); 244 expect(result.location.offset, codeUser.indexOf("'my_lib.dart'; // U"));
244 expect(result.location.length, "'my_lib.dart'".length); 245 expect(result.location.length, "'my_lib.dart'".length);
245 } 246 }
246 // in T 247 // in T
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 print(vvv); 880 print(vvv);
880 } 881 }
881 '''); 882 ''');
882 Request request = new SearchFindElementReferencesParams(testFile, 0, false) 883 Request request = new SearchFindElementReferencesParams(testFile, 0, false)
883 .toRequest('0'); 884 .toRequest('0');
884 Response response = await waitResponse(request); 885 Response response = await waitResponse(request);
885 expect(response.error, isNotNull); 886 expect(response.error, isNotNull);
886 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); 887 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED);
887 } 888 }
888 } 889 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698