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

Unified Diff: pkg/analysis_server/test/services/refactoring/rename_class_member_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_class_member_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
index 51b7402bba2adc2aa0e7b16940c59f37227b8d67..3f0ee70db868bdcfed263383ff457afd2477bc89 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
@@ -241,6 +241,21 @@ class B extends A {
expectedContextSearch: 'newName() {} // marker');
}
+ test_checkInitialConditions_inSDK() async {
+ indexTestUnit('''
+main() {
+ 'abc'.toUpperCase();
+}
+''');
+ createRenameRefactoringAtString('toUpperCase()');
+ // check status
+ refactoring.newName = 'NewName';
+ RefactoringStatus status = await refactoring.checkInitialConditions();
+ assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
+ expectedMessage:
+ "The method 'String.toUpperCase' is defined in the SDK, so cannot be renamed.");
+ }
+
test_checkInitialConditions_operator() async {
indexTestUnit('''
class A {

Powered by Google App Engine
This is Rietveld 408576698