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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/QuickAssistProcessorTest.java

Issue 10825190: Don't infer non-final field types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tests for 'const' 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/correction/QuickAssistProcessorTest.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/QuickAssistProcessorTest.java b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/QuickAssistProcessorTest.java
index ba99796dad617e2eb8baf998315e0cf79c785cfc..aa80396b546a5abbb2c118d453ad53da9ccc0460 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/QuickAssistProcessorTest.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/QuickAssistProcessorTest.java
@@ -43,6 +43,10 @@ public final class QuickAssistProcessorTest extends AbstractDartTest {
private IProblemLocation problemLocations[] = NO_PROBLEMS;
private int selectionLength = 0;
+ public void test_addTypeAnnotation_classField_OK_final() throws Exception {
+ assert_addTypeAnnotation_classField("final v = 1;", " = 1", "final int v = 1;");
+ }
+
public void test_addTypeAnnotation_classField_OK_int() throws Exception {
assert_addTypeAnnotation_classField("var v = 1;", " = 1", "int v = 1;");
}
@@ -98,6 +102,11 @@ public final class QuickAssistProcessorTest extends AbstractDartTest {
assert_addTypeAnnotation_topLevelField(source, "var ", source);
}
+ public void test_addTypeAnnotation_topLevelField_wrong_noValue() throws Exception {
+ String source = "var v;";
+ assert_addTypeAnnotation_topLevelField(source, "var ", source);
+ }
+
public void test_convertToBlockBody_OK_onMethodName() throws Exception {
String initial = makeSource(
"// 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/ui/internal/text/correction/QuickAssistProcessor.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698