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

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

Issue 908503004: Quick Assist to add explicit types to formal parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak and add TODO Created 5 years, 10 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 1b252f37f7abff02c69c1c019a5d307641cf3640..5db7631a888d0c5e015222f1eb9c23dc1c7d5eeb 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -531,6 +531,41 @@ main() {
assertNoAssistAt('var ', AssistKind.ADD_TYPE_ANNOTATION);
}
+ void test_addTypeAnnotation_parameter_BAD_hasExplicitType() {
+ _indexTestUnit('''
+foo(f(int p)) {}
+main() {
+ foo((num test) {});
+}
+''');
+ assertNoAssistAt('test', AssistKind.ADD_TYPE_ANNOTATION);
+ }
+
+ void test_addTypeAnnotation_parameter_BAD_noPropagatedType() {
+ _indexTestUnit('''
+foo(f(p)) {}
+main() {
+ foo((test) {});
+}
+''');
+ assertNoAssistAt('test', AssistKind.ADD_TYPE_ANNOTATION);
+ }
+
+ void test_addTypeAnnotation_parameter_OK() {
+ _indexTestUnit('''
+foo(f(int p)) {}
+main() {
+ foo((test) {});
+}
+''');
+ assertHasAssistAt('test', AssistKind.ADD_TYPE_ANNOTATION, '''
+foo(f(int p)) {}
+main() {
+ foo((int test) {});
+}
+''');
+ }
+
void test_addTypeAnnotation_topLevelField_OK_int() {
_indexTestUnit('''
var V = 0;
« 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