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

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

Issue 1492053004: Issue 25095. Add 'Change X to Y type annotation' Quick Fix. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/fix_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/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() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698