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

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

Issue 11273064: Issue 5887. Parts must start with 'part of'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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/RenameFunctionTypeAliasProcessorTest.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameFunctionTypeAliasProcessorTest.java b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameFunctionTypeAliasProcessorTest.java
index 2f1de4fe440b2e3a23594318d3f486edbad7ec13..2b5ae0d1a5e7cea657cbc15ac56bcbfcdd18eca3 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameFunctionTypeAliasProcessorTest.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameFunctionTypeAliasProcessorTest.java
@@ -101,21 +101,21 @@ public final class RenameFunctionTypeAliasProcessorTest extends RefactoringTest
}
public void test_OK_multipleUnits_onReference() throws Exception {
- setUnitContent(
- "Test1.dart",
+ setUnitContent("Test1.dart", new String[] {
"// filler filler filler filler filler filler filler filler filler filler",
+ "part of test;",
"typedef Test();",
- "");
- setUnitContent(
- "Test2.dart",
+ ""});
+ setUnitContent("Test2.dart", new String[] {
"// filler filler filler filler filler filler filler filler filler filler",
+ "part of test;",
"f(Test test) {",
- "}");
+ "}"});
setTestUnitContent(
"// filler filler filler filler filler filler filler filler filler filler",
- "#library('test');",
- "#source('Test1.dart');",
- "#source('Test2.dart');");
+ "library test;",
+ "part 'Test1.dart';",
+ "part 'Test2.dart';");
// get units, because they have not library
CompilationUnit unit1 = testProject.getUnit("Test1.dart");
CompilationUnit unit2 = testProject.getUnit("Test2.dart");
@@ -123,16 +123,16 @@ public final class RenameFunctionTypeAliasProcessorTest extends RefactoringTest
DartFunctionTypeAlias functionTypeAlias = findElement(unit2, "Test test");
// do rename
renameType(functionTypeAlias, "NewName");
- assertUnitContent(
- unit1,
+ assertUnitContent(unit1, new String[] {
"// filler filler filler filler filler filler filler filler filler filler",
+ "part of test;",
"typedef NewName();",
- "");
- assertUnitContent(
- unit2,
+ ""});
+ assertUnitContent(unit2, new String[] {
"// filler filler filler filler filler filler filler filler filler filler",
+ "part of test;",
"f(NewName test) {",
- "}");
+ "}"});
}
public void test_OK_singleUnit_onDeclaration() throws Exception {
@@ -504,8 +504,11 @@ public final class RenameFunctionTypeAliasProcessorTest extends RefactoringTest
assertThat(openInformationMessages).isEmpty();
assertThat(showStatusMessages).hasSize(1);
assertEquals(RefactoringStatus.ERROR, showStatusSeverities.get(0).intValue());
- assertEquals("File 'Test/" + unitName + "' in library 'Test' already declares top-level "
- + shadowName + " 'NewName'", showStatusMessages.get(0));
+ assertEquals("File 'Test/"
+ + unitName
+ + "' in library 'Test' already declares top-level "
+ + shadowName
+ + " 'NewName'", showStatusMessages.get(0));
// no source changes
assertEquals(source, testUnit.getSource());
}

Powered by Google App Engine
This is Rietveld 408576698