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

Side by Side Diff: pkg/analysis_server/test/services/search/search_engine_test.dart

Issue 1164823003: Replace 'Element.node' with 'Element.computeNode()'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/inline_method.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 addSource('/unitA.dart', codeA); 345 addSource('/unitA.dart', codeA);
346 addSource('/unitB.dart', codeB); 346 addSource('/unitB.dart', codeB);
347 _indexTestUnit(''' 347 _indexTestUnit('''
348 library lib; 348 library lib;
349 part 'unitA.dart'; 349 part 'unitA.dart';
350 part 'unitB.dart'; 350 part 'unitB.dart';
351 '''); 351 ''');
352 LibraryElement element = testLibraryElement; 352 LibraryElement element = testLibraryElement;
353 CompilationUnitElement elementA = element.parts[0]; 353 CompilationUnitElement elementA = element.parts[0];
354 CompilationUnitElement elementB = element.parts[1]; 354 CompilationUnitElement elementB = element.parts[1];
355 index.indexUnit(context, elementA.node); 355 index.indexUnit(context, elementA.computeNode());
356 index.indexUnit(context, elementB.node); 356 index.indexUnit(context, elementB.computeNode());
357 var expected = [ 357 var expected = [
358 new ExpectedMatch(elementA, MatchKind.REFERENCE, 358 new ExpectedMatch(elementA, MatchKind.REFERENCE,
359 codeA.indexOf('lib; // A'), 'lib'.length), 359 codeA.indexOf('lib; // A'), 'lib'.length),
360 new ExpectedMatch(elementB, MatchKind.REFERENCE, 360 new ExpectedMatch(elementB, MatchKind.REFERENCE,
361 codeB.indexOf('lib; // B'), 'lib'.length), 361 codeB.indexOf('lib; // B'), 'lib'.length),
362 ]; 362 ];
363 return _verifyReferences(element, expected); 363 return _verifyReferences(element, expected);
364 } 364 }
365 365
366 Future test_searchReferences_LocalVariableElement() { 366 Future test_searchReferences_LocalVariableElement() {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 .then((List<SearchMatch> matches) { 639 .then((List<SearchMatch> matches) {
640 _assertMatches(matches, expectedMatches); 640 _assertMatches(matches, expectedMatches);
641 }); 641 });
642 } 642 }
643 643
644 static void _assertMatches( 644 static void _assertMatches(
645 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { 645 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) {
646 expect(matches, unorderedEquals(expectedMatches)); 646 expect(matches, unorderedEquals(expectedMatches));
647 } 647 }
648 } 648 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/inline_method.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698