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

Side by Side Diff: pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart

Issue 489973002: Initial 'Extract Local' implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: tweaks Created 6 years, 4 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 | Annotate | Revision Log
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.refactoring.rename; 5 library test.services.refactoring;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/services/correction/change.dart'; 9 import 'package:analysis_server/src/services/correction/change.dart';
10 import 'package:analysis_server/src/services/correction/status.dart'; 10 import 'package:analysis_server/src/services/correction/status.dart';
11 import 'package:analysis_server/src/services/index/index.dart'; 11 import 'package:analysis_server/src/services/index/index.dart';
12 import 'package:analysis_server/src/services/index/local_memory_index.dart'; 12 import 'package:analysis_server/src/services/index/local_memory_index.dart';
13 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; 13 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
14 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ; 14 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ;
15 import 'package:analysis_testing/abstract_single_unit.dart'; 15 import 'package:analysis_testing/abstract_single_unit.dart';
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 } 83 }
84 84
85 /** 85 /**
86 * Asserts that [refactoring] status is OK. 86 * Asserts that [refactoring] status is OK.
87 */ 87 */
88 void assertRefactoringStatusOK(RefactoringStatus status) { 88 void assertRefactoringStatusOK(RefactoringStatus status) {
89 assertRefactoringStatus(status, RefactoringStatusSeverity.OK); 89 assertRefactoringStatus(status, RefactoringStatusSeverity.OK);
90 } 90 }
91 91
92 /**
93 * Asserts that [refactoringChange] contains a [FileEdit] for [testFile], and
94 * it results the [expectedCode].
95 */
96 void assertTestChangeResult(String expectedCode) {
97 // prepare FileEdit
98 FileEdit fileEdit = refactoringChange.getFileEdit(testFile);
99 expect(fileEdit, isNotNull);
100 // validate resulting code
101 String actualCode = applySequence(testCode, fileEdit.edits);
102 expect(actualCode, expectedCode);
103 }
104
92 void indexTestUnit(String code) { 105 void indexTestUnit(String code) {
93 resolveTestUnit(code); 106 resolveTestUnit(code);
94 index.indexUnit(context, testUnit); 107 index.indexUnit(context, testUnit);
95 } 108 }
96 109
97 void indexUnit(String file, String code) { 110 void indexUnit(String file, String code) {
98 Source source = addSource(file, code); 111 Source source = addSource(file, code);
99 CompilationUnit unit = resolveLibraryUnit(source); 112 CompilationUnit unit = resolveLibraryUnit(source);
100 index.indexUnit(context, unit); 113 index.indexUnit(context, unit);
101 } 114 }
102 115
103 void setUp() { 116 void setUp() {
104 super.setUp(); 117 super.setUp();
105 index = createLocalMemoryIndex(); 118 index = createLocalMemoryIndex();
106 searchEngine = new SearchEngineImpl(index); 119 searchEngine = new SearchEngineImpl(index);
107 } 120 }
108 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698