Index: pkg/analysis_server/test/services/correction/fix_test.dart |
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart |
index a54eb0085168550511eccd2fab76a53f3c558375..bd7fbc5e6732f9388e75143657a7d349a7faaa29 100644 |
--- a/pkg/analysis_server/test/services/correction/fix_test.dart |
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart |
@@ -597,6 +597,45 @@ main(B b) { |
'''); |
} |
+ test_changeTypeAnnotation_BAD_multipleVariables() async { |
+ resolveTestUnit(''' |
+main() { |
+ String a, b = 42; |
+} |
+'''); |
+ await assertNoFix(DartFixKind.CHANGE_TYPE_ANNOTATION); |
+ } |
+ |
+ test_changeTypeAnnotation_OK_generic() async { |
+ resolveTestUnit(''' |
+main() { |
+ String v = <int>[]; |
+} |
+'''); |
+ await assertHasFix( |
+ DartFixKind.CHANGE_TYPE_ANNOTATION, |
+ ''' |
+main() { |
+ List<int> v = <int>[]; |
+} |
+'''); |
+ } |
+ |
+ test_changeTypeAnnotation_OK_simple() async { |
+ resolveTestUnit(''' |
+main() { |
+ String v = 'abc'.length; |
+} |
+'''); |
+ await assertHasFix( |
+ DartFixKind.CHANGE_TYPE_ANNOTATION, |
+ ''' |
+main() { |
+ int v = 'abc'.length; |
+} |
+'''); |
+ } |
Brian Wilkerson
2015/12/03 01:48:04
Perhaps also
f(String s) {
s = 42;
}
|
+ |
test_createClass() async { |
resolveTestUnit(''' |
main() { |