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

Unified Diff: pkg/analysis_server/test/services/refactoring/rename_import_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: Tweak for test - reference ambiguous prefix name. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/services/refactoring/abstract_rename.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/refactoring/rename_import_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
index 0e28f419b37f22660842776cef2230fdb2e36ec8..c744b598126a0fbd82416528de1eae5c7f491208 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
@@ -93,6 +93,33 @@ main() {
''');
}
+ test_createChange_change_onPrefixElement() {
+ indexTestUnit('''
+import 'dart:async' as test;
+import 'dart:math' as test;
+main() {
+ test.Future f;
+ test.PI;
+ test.E;
+}
+''');
+ // configure refactoring
+ createRenameRefactoringAtString('test.PI');
+ expect(refactoring.refactoringName, 'Rename Import Prefix');
+ expect(refactoring.oldName, 'test');
+ refactoring.newName = 'newName';
+ // validate change
+ return assertSuccessfulRename('''
+import 'dart:async' as test;
+import 'dart:math' as newName;
+main() {
+ test.Future f;
+ newName.PI;
+ newName.E;
+}
+''');
+ }
+
test_createChange_change_function() {
indexTestUnit('''
import 'dart:math' as test;
« no previous file with comments | « pkg/analysis_server/test/services/refactoring/abstract_rename.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698