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

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

Issue 1629533003: Issue 25404. 'Inline Method' should update implicit 'this' and class references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/inline_method.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/refactoring/inline_method_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
index 8ff6c84708564f2c75827f749c2912289abb689d..f07f363ec2a667f6b02de0027fef2cb2a4aa626f 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
@@ -917,6 +917,81 @@ class A {
''');
}
+ test_method_methodInstance() {
+ indexTestUnit(r'''
+class A {
+ ma() {}
+}
+class B extends A {
+ test() {
+ ma();
+ mb();
+ }
+ mb() {}
+}
+main(B b) {
+ b.test();
+}
+''');
+ _createRefactoring('test();');
+ // validate change
+ return _assertSuccessfulRefactoring(r'''
+class A {
+ ma() {}
+}
+class B extends A {
+ test() {
+ ma();
+ mb();
+ }
+ mb() {}
+}
+main(B b) {
+ b.ma();
+ b.mb();
+}
+''');
+ }
+
+ test_method_methodStatic() {
+ indexTestUnit(r'''
+class A {
+ static ma() {}
+}
+class B extends A {
+ static mb() {}
+ test() {
+ mb();
+ A.ma();
+ B.mb();
+ }
+}
+main(B b) {
+ b.test();
+}
+''');
+ _createRefactoring('test();');
+ // validate change
+ return _assertSuccessfulRefactoring(r'''
+class A {
+ static ma() {}
+}
+class B extends A {
+ static mb() {}
+ test() {
+ mb();
+ A.ma();
+ B.mb();
+ }
+}
+main(B b) {
+ B.mb();
+ A.ma();
+ B.mb();
+}
+''');
+ }
+
test_method_singleStatement() {
indexTestUnit(r'''
class A {
@@ -973,7 +1048,7 @@ main() {
''');
}
- test_method_unqualifiedUnvocation() {
+ test_method_unqualifiedInvocation() {
indexTestUnit(r'''
class A {
test(a, b) {
@@ -1361,7 +1436,7 @@ main() {
''');
}
- test_singleExpression_wrapIntoParenthesized_bools() {
+ test_singleExpression_wrapIntoParenthesized_bool() {
indexTestUnit(r'''
test(bool a, bool b) {
return a || b;
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/inline_method.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698