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

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

Issue 499723002: Implement 'edit.getRefactoring' for rename refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for comment 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.extract_local; 5 library test.services.refactoring.extract_local;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol2.dart'; 9 import 'package:analysis_server/src/protocol2.dart';
10 import 'package:analysis_server/src/services/correction/change.dart'; 10 import 'package:analysis_server/src/services/correction/change.dart';
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 main() { 197 main() {
198 int a = 1 + 2; 198 int a = 1 + 2;
199 } 199 }
200 '''); 200 ''');
201 _createRefactoringForString('1 + 2'); 201 _createRefactoringForString('1 + 2');
202 expect(refactoring.refactoringName, 'Extract Local Variable'); 202 expect(refactoring.refactoringName, 'Extract Local Variable');
203 // null 203 // null
204 refactoring.name = null; 204 refactoring.name = null;
205 assertRefactoringStatus( 205 assertRefactoringStatus(
206 refactoring.checkName(), 206 refactoring.checkName(),
207 RefactoringProblemSeverity.ERROR, 207 RefactoringProblemSeverity.FATAL,
208 expectedMessage: "Variable name must not be null."); 208 expectedMessage: "Variable name must not be null.");
209 // empty 209 // empty
210 refactoring.name = ''; 210 refactoring.name = '';
211 assertRefactoringStatus( 211 assertRefactoringStatus(
212 refactoring.checkName(), 212 refactoring.checkName(),
213 RefactoringProblemSeverity.ERROR, 213 RefactoringProblemSeverity.FATAL,
214 expectedMessage: "Variable name must not be empty."); 214 expectedMessage: "Variable name must not be empty.");
215 // OK 215 // OK
216 refactoring.name = 'res'; 216 refactoring.name = 'res';
217 assertRefactoringStatusOK(refactoring.checkName()); 217 assertRefactoringStatusOK(refactoring.checkName());
218 } 218 }
219 219
220 test_completeStatementExpression() { 220 test_completeStatementExpression() {
221 indexTestUnit(''' 221 indexTestUnit('''
222 main(p) { 222 main(p) {
223 p.toString(); 223 p.toString();
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 int length = search.length; 897 int length = search.length;
898 _createRefactoring(offset, length); 898 _createRefactoring(offset, length);
899 } 899 }
900 900
901 void _createRefactoringWithSuffix(String selectionSearch, String suffix) { 901 void _createRefactoringWithSuffix(String selectionSearch, String suffix) {
902 int offset = findOffset(selectionSearch + suffix); 902 int offset = findOffset(selectionSearch + suffix);
903 int length = selectionSearch.length; 903 int length = selectionSearch.length;
904 _createRefactoring(offset, length); 904 _createRefactoring(offset, length);
905 } 905 }
906 } 906 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/mocks.dart ('k') | pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698