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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/InlineMethodRefactoringTest.java

Issue 11577022: Issue 7093. Support for inlining function references. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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: 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",
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/InlineMethodRefactoring.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698