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

Unified Diff: pkg/analysis_server/test/services/refactoring/rename_import_test.dart

Issue 485083004: Make RefactoringStatus a collection of generated RefactoringProblems. (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 side-by-side diff with in-line comments
Download patch
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 c744b598126a0fbd82416528de1eae5c7f491208..92f1cdcf83fc84b784e02e290919f1ea188bc9cc 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
@@ -4,7 +4,7 @@
library test.services.refactoring.rename_import;
-import 'package:analysis_server/src/services/correction/status.dart';
+import 'package:analysis_server/src/protocol2.dart';
import 'package:analysis_testing/reflective_tests.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:unittest/unittest.dart';
@@ -28,13 +28,13 @@ class RenameImportTest extends RenameRefactoringTest {
refactoring.newName = null;
assertRefactoringStatus(
refactoring.checkNewName(),
- RefactoringStatusSeverity.ERROR,
+ RefactoringProblemSeverity.ERROR,
expectedMessage: "Import prefix name must not be null.");
// same
refactoring.newName = 'test';
assertRefactoringStatus(
refactoring.checkNewName(),
- RefactoringStatusSeverity.FATAL,
+ RefactoringProblemSeverity.FATAL,
expectedMessage: "The new name must be different than the current name.");
// empty
refactoring.newName = '';
@@ -93,54 +93,54 @@ main() {
''');
}
- test_createChange_change_onPrefixElement() {
+ test_createChange_change_function() {
indexTestUnit('''
-import 'dart:async' as test;
import 'dart:math' as test;
+import 'dart:async' as test;
main() {
+ test.max(1, 2);
test.Future f;
- test.PI;
- test.E;
}
''');
// configure refactoring
- createRenameRefactoringAtString('test.PI');
+ _createRefactoring("import 'dart:math");
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;
+import 'dart:async' as test;
main() {
+ newName.max(1, 2);
test.Future f;
- newName.PI;
- newName.E;
}
''');
}
- test_createChange_change_function() {
+ test_createChange_change_onPrefixElement() {
indexTestUnit('''
-import 'dart:math' as test;
import 'dart:async' as test;
+import 'dart:math' as test;
main() {
- test.max(1, 2);
test.Future f;
+ test.PI;
+ test.E;
}
''');
// configure refactoring
- _createRefactoring("import 'dart:math");
+ createRenameRefactoringAtString('test.PI');
expect(refactoring.refactoringName, 'Rename Import Prefix');
expect(refactoring.oldName, 'test');
refactoring.newName = 'newName';
// validate change
return assertSuccessfulRename('''
-import 'dart:math' as newName;
import 'dart:async' as test;
+import 'dart:math' as newName;
main() {
- newName.max(1, 2);
test.Future f;
+ newName.PI;
+ newName.E;
}
''');
}

Powered by Google App Engine
This is Rietveld 408576698