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

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

Issue 1377623002: Report a fatal error on attempt to rename an element declared in SDK. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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_constructor_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
index 03b1693e12fc4563c98ad6919964c758da86d287..2bc8dc0548f3c1e9131e42a8b9aec2eb577c7294 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
@@ -55,6 +55,21 @@ class A {
expectedContextSearch: 'newName() {} // existing');
}
+ test_checkInitialConditions_inSDK() async {
+ indexTestUnit('''
+main() {
+ new String.fromCharCodes([]);
+}
+''');
+ createRenameRefactoringAtString('fromCharCodes(');
+ // check status
+ refactoring.newName = 'newName';
+ RefactoringStatus status = await refactoring.checkInitialConditions();
+ assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
+ expectedMessage:
+ "The constructor 'String.fromCharCodes' is defined in the SDK, so cannot be renamed.");
+ }
+
test_checkNewName() {
indexTestUnit('''
class A {

Powered by Google App Engine
This is Rietveld 408576698