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

Unified Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 1051733003: Fix removing type annotations for const/final variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/correction/assist_test.dart
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index 52764fe41f8738b065886b262c6827cfc910f4aa..9d36c59b7b89783b6025e21c1569fa4cec99aa86 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -2324,6 +2324,19 @@ class A {
''');
}
+ void test_removeTypeAnnotation_classField_OK_final() {
+ resolveTestUnit('''
+class A {
+ final int v = 1;
+}
+''');
+ assertHasAssistAt('v = ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+class A {
+ final v = 1;
+}
+''');
+ }
+
void test_removeTypeAnnotation_localVariable_OK() {
resolveTestUnit('''
main() {
@@ -2337,6 +2350,32 @@ main() {
''');
}
+ void test_removeTypeAnnotation_localVariable_OK_const() {
+ resolveTestUnit('''
+main() {
+ const int v = 1;
+}
+''');
+ assertHasAssistAt('int ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+main() {
+ const v = 1;
+}
+''');
+ }
+
+ void test_removeTypeAnnotation_localVariable_OK_final() {
+ resolveTestUnit('''
+main() {
+ final int v = 1;
+}
+''');
+ assertHasAssistAt('int ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+main() {
+ final v = 1;
+}
+''');
+ }
+
void test_removeTypeAnnotation_topLevelVariable_OK() {
resolveTestUnit('''
int V = 1;
@@ -2346,6 +2385,15 @@ var V = 1;
''');
}
+ void test_removeTypeAnnotation_topLevelVariable_OK_final() {
+ resolveTestUnit('''
+final int V = 1;
+''');
+ assertHasAssistAt('int ', AssistKind.REMOVE_TYPE_ANNOTATION, '''
+final V = 1;
+''');
+ }
+
void test_replaceConditionalWithIfElse_OK_assignment() {
resolveTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698