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

Unified Diff: pkg/analysis_server/test/edit/refactoring_test.dart

Issue 640253004: Fix for renaming import without an import prefix. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
Index: pkg/analysis_server/test/edit/refactoring_test.dart
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index 24b8df29e614a0241b5a00af2445338ca2919128..b910a65d2614cd7f4b996c491ca48a127ac91ea2 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -1258,6 +1258,48 @@ main() {
''');
}
+ test_importPrefix_add() {
+ addTestFile('''
+import 'dart:math';
+import 'dart:async';
+main() {
+ Random r;
+ Future f;
+}
+''');
+ return assertSuccessfulRefactoring(() {
+ return sendRenameRequest("import 'dart:async';", 'new_name');
+ }, '''
+import 'dart:math';
+import 'dart:async' as new_name;
+main() {
+ Random r;
+ new_name.Future f;
+}
+''');
+ }
+
+ test_importPrefix_remove() {
+ addTestFile('''
+import 'dart:math' as test;
+import 'dart:async' as test;
+main() {
+ test.Random r;
+ test.Future f;
+}
+''');
+ return assertSuccessfulRefactoring(() {
+ return sendRenameRequest("import 'dart:async' as test;", '');
+ }, '''
+import 'dart:math' as test;
+import 'dart:async';
+main() {
+ test.Random r;
+ Future f;
+}
+''');
+ }
+
test_init_fatalError_noElement() {
addTestFile('// nothing to rename');
return getRefactoringResult(() {

Powered by Google App Engine
This is Rietveld 408576698