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

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

Issue 10915031: Issue 4796. Support for renaming named parameters in invocations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameLocalVariableProcessorTest.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameLocalVariableProcessorTest.java b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameLocalVariableProcessorTest.java
index cb2f4a54989673459f0090e4e959a9571dce045c..59b2024436c334bd604c70a4a97d4bbbcac4fc3e 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameLocalVariableProcessorTest.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameLocalVariableProcessorTest.java
@@ -216,6 +216,46 @@ public final class RenameLocalVariableProcessorTest extends RefactoringTest {
"}");
}
+ public void test_OK_parameter_named_onDeclaration() throws Exception {
+ setTestUnitContent(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "f({test: 10}) {}",
+ "main() {",
+ " f(test: 42);",
+ "}",
+ "");
+ DartVariableDeclaration variable = findElement("test: 10");
+ // do rename
+ renameLocalVariable(variable, "newName");
+ assertTestUnitContent(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "f({newName: 10}) {}",
+ "main() {",
+ " f(newName: 42);",
+ "}",
+ "");
+ }
+
+ public void test_OK_parameter_named_onInvocation() throws Exception {
+ setTestUnitContent(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "f({test: 10}) {}",
+ "main() {",
+ " f(test: 42);",
+ "}",
+ "");
+ DartVariableDeclaration variable = findElement("test: 42");
+ // do rename
+ renameLocalVariable(variable, "newName");
+ assertTestUnitContent(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "f({newName: 10}) {}",
+ "main() {",
+ " f(newName: 42);",
+ "}",
+ "");
+ }
+
public void test_OK_parameter_onDeclaration() throws Exception {
setTestUnitContent(
"// filler filler filler filler filler filler filler filler filler filler",

Powered by Google App Engine
This is Rietveld 408576698