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

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

Issue 749173002: Issue 21613. Fix for renaming FieldFormalParameterElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Additional tests. Created 6 years, 1 month 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 76350befedc40c6a66bf5343ad231ebb8330151e..cbfc511bbb3c923284cfe3443f31f54a8b3512ea 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -1071,6 +1071,7 @@ main() {
addTestFile('''
class A {
var test = 0;
+ A(this.test);
main() {
print(test);
}
@@ -1081,6 +1082,7 @@ class A {
}, '''
class A {
var newName = 0;
+ A(this.newName);
main() {
print(newName);
}
@@ -1088,6 +1090,52 @@ class A {
''');
}
+ test_classMember_field_onFieldFormalParameter() {
+ addTestFile('''
+class A {
+ var test = 0;
+ A(this.test);
+ main() {
+ print(test);
+ }
+}
+''');
+ return assertSuccessfulRefactoring(() {
+ return sendRenameRequest('test);', 'newName');
+ }, '''
+class A {
+ var newName = 0;
+ A(this.newName);
+ main() {
+ print(newName);
+ }
+}
+''');
+ }
+
+ test_classMember_field_onFieldFormalParameter_named() {
+ addTestFile('''
+class A {
+ final int test;
+ A({this.test: 0});
+}
+main() {
+ new A(test: 42);
+}
+''');
+ return assertSuccessfulRefactoring(() {
+ return sendRenameRequest('test: 42', 'newName');
+ }, '''
+class A {
+ final int newName;
+ A({this.newName: 0});
+}
+main() {
+ new A(newName: 42);
+}
+''');
+ }
+
test_classMember_getter() {
addTestFile('''
class A {

Powered by Google App Engine
This is Rietveld 408576698