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

Side by Side Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 556793007: Issue 20892. Quick Fix 'Import Library' for type arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.services.correction.fix; 5 library test.services.correction.fix;
6 6
7 import 'package:analysis_server/src/protocol.dart' hide AnalysisError; 7 import 'package:analysis_server/src/protocol.dart' hide AnalysisError;
8 import 'package:analysis_server/src/services/correction/fix.dart'; 8 import 'package:analysis_server/src/services/correction/fix.dart';
9 import 'package:analysis_server/src/services/index/index.dart'; 9 import 'package:analysis_server/src/services/index/index.dart';
10 import 'package:analysis_server/src/services/index/local_memory_index.dart'; 10 import 'package:analysis_server/src/services/index/local_memory_index.dart';
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 '''); 1138 ''');
1139 assertHasFix(FixKind.IMPORT_LIBRARY_SDK, ''' 1139 assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
1140 import 'dart:async'; 1140 import 'dart:async';
1141 1141
1142 main() { 1142 main() {
1143 Future.wait; 1143 Future.wait;
1144 } 1144 }
1145 '''); 1145 ''');
1146 } 1146 }
1147 1147
1148 void test_importLibrarySdk_withType_typeArgument() {
1149 _indexTestUnit('''
1150 main() {
1151 List<Future> futures = [];
1152 }
1153 ''');
1154 assertHasFix(FixKind.IMPORT_LIBRARY_SDK, '''
1155 import 'dart:async';
1156
1157 main() {
1158 List<Future> futures = [];
1159 }
1160 ''');
1161 }
1162
1148 void test_importLibraryShow() { 1163 void test_importLibraryShow() {
1149 _indexTestUnit(''' 1164 _indexTestUnit('''
1150 import 'dart:async' show Stream; 1165 import 'dart:async' show Stream;
1151 main() { 1166 main() {
1152 Stream s = null; 1167 Stream s = null;
1153 Future f = null; 1168 Future f = null;
1154 } 1169 }
1155 '''); 1170 ''');
1156 assertHasFix(FixKind.IMPORT_LIBRARY_SHOW, ''' 1171 assertHasFix(FixKind.IMPORT_LIBRARY_SHOW, '''
1157 import 'dart:async' show Future, Stream; 1172 import 'dart:async' show Future, Stream;
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 positions.add(new Position(testFile, offset)); 1955 positions.add(new Position(testFile, offset));
1941 } 1956 }
1942 return positions; 1957 return positions;
1943 } 1958 }
1944 1959
1945 void _indexTestUnit(String code) { 1960 void _indexTestUnit(String code) {
1946 resolveTestUnit(code); 1961 resolveTestUnit(code);
1947 index.indexUnit(context, testUnit); 1962 index.indexUnit(context, testUnit);
1948 } 1963 }
1949 } 1964 }
OLDNEW
« 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