| Index: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/InlineMethodRefactoringTest.java
|
| diff --git a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/InlineMethodRefactoringTest.java b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/InlineMethodRefactoringTest.java
|
| index e43ba3100ed8bda2c35b51bf984b92cd5d91aeda..3c68b765b123310a5a0d620a23a60e1578af2d99 100644
|
| --- a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/InlineMethodRefactoringTest.java
|
| +++ b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/InlineMethodRefactoringTest.java
|
| @@ -524,6 +524,70 @@ public final class InlineMethodRefactoringTest extends RefactoringTest {
|
| "");
|
| }
|
|
|
| + public void test_reference_toClassMethod() throws Exception {
|
| + setTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {",
|
| + " test(a, b) {",
|
| + " print(a);",
|
| + " print(b);",
|
| + " }",
|
| + "}",
|
| + "main() {",
|
| + " print(new A().test);",
|
| + "}");
|
| + selection = findOffset("test(a, b)");
|
| + createRefactoring();
|
| + // error
|
| + assertTrue(refactoringStatus.hasFatalError());
|
| + }
|
| +
|
| + public void test_reference_toLocal() throws Exception {
|
| + setTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "main() {",
|
| + " test(a, b) {",
|
| + " print(a);",
|
| + " print(b);",
|
| + " }",
|
| + " print(test);",
|
| + "}");
|
| + selection = findOffset("test(a, b)");
|
| + // do refactoring
|
| + doSuccessfullRefactoring();
|
| + assertTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "main() {",
|
| + " print((a, b) {",
|
| + " print(a);",
|
| + " print(b);",
|
| + " });",
|
| + "}");
|
| + }
|
| +
|
| + public void test_reference_toTopLevel() throws Exception {
|
| + setTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "test(a, b) {",
|
| + " print(a);",
|
| + " print(b);",
|
| + "}",
|
| + "main() {",
|
| + " print(test);",
|
| + "}");
|
| + selection = findOffset("test(a, b)");
|
| + // do refactoring
|
| + doSuccessfullRefactoring();
|
| + assertTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "main() {",
|
| + " print((a, b) {",
|
| + " print(a);",
|
| + " print(b);",
|
| + " });",
|
| + "}");
|
| + }
|
| +
|
| public void test_singleExpression_oneUsage() throws Exception {
|
| setTestUnitContent(
|
| "// filler filler filler filler filler filler filler filler filler filler",
|
|
|