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

Side by Side Diff: pkg/analysis_server/test/edit/refactoring_test.dart

Issue 481173002: When user renames 'prefix' in 'prefix.Class' she actually wants to rename ImportElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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.edit.refactoring; 5 library test.edit.refactoring;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/edit/edit_domain.dart'; 10 import 'package:analysis_server/src/edit/edit_domain.dart';
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 Future test_rename_hasElement_importElement_directive() { 80 Future test_rename_hasElement_importElement_directive() {
81 return assertHasRenameRefactoring(''' 81 return assertHasRenameRefactoring('''
82 import 'dart:math' as math; 82 import 'dart:math' as math;
83 main() { 83 main() {
84 math.PI; 84 math.PI;
85 } 85 }
86 ''', 'import '); 86 ''', 'import ');
87 } 87 }
88 88
89 Future test_rename_hasElement_importElement_prefixDecl() {
90 return assertHasRenameRefactoring('''
91 import 'dart:math' as math;
92 main() {
93 math.PI;
94 }
95 ''', 'math;');
96 }
97
98 Future test_rename_hasElement_importElement_prefixRef() {
Brian Wilkerson 2014/08/18 21:42:34 Possibly test an ambiguous case.
scheglov 2014/08/18 21:49:41 Done.
99 return assertHasRenameRefactoring('''
100 import 'dart:math' as math;
101 main() {
102 math.PI;
103 }
104 ''', 'math.PI;');
105 }
106
89 Future test_rename_hasElement_instanceGetter() { 107 Future test_rename_hasElement_instanceGetter() {
90 return assertHasRenameRefactoring(''' 108 return assertHasRenameRefactoring('''
91 class A { 109 class A {
92 get test => 0; 110 get test => 0;
93 } 111 }
94 main(A a) { 112 main(A a) {
95 a.test; 113 a.test;
96 } 114 }
97 ''', 'test;'); 115 ''', 'test;');
98 } 116 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 main() { 157 main() {
140 // not an element 158 // not an element
141 } 159 }
142 '''); 160 ''');
143 return waitForTasksFinished().then((_) { 161 return waitForTasksFinished().then((_) {
144 List<String> kinds = getAvailableRefactorings('// not an element'); 162 List<String> kinds = getAvailableRefactorings('// not an element');
145 expect(kinds, isNot(contains(RefactoringKind.RENAME))); 163 expect(kinds, isNot(contains(RefactoringKind.RENAME)));
146 }); 164 });
147 } 165 }
148 } 166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698