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

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

Issue 2650803005: Make Analysis Server tests use MockSdk again. (Closed)
Patch Set: Created 3 years, 11 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
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 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; 9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; 10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart';
(...skipping 4269 matching lines...) Expand 10 before | Expand all | Expand 10 after
4280 process(items); 4280 process(items);
4281 } 4281 }
4282 } 4282 }
4283 4283
4284 void process(List<int> items) { 4284 void process(List<int> items) {
4285 } 4285 }
4286 '''); 4286 ''');
4287 _assertLinkedGroup( 4287 _assertLinkedGroup(
4288 change.linkedEditGroups[2], 4288 change.linkedEditGroups[2],
4289 ['List<int> items) {'], 4289 ['List<int> items) {'],
4290 expectedSuggestions(LinkedEditSuggestionKind.TYPE, [ 4290 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4291 'List<int>', 4291 ['List<int>', 'Iterable<int>', 'Object']));
4292 'EfficientLengthIterable<int>',
4293 'Iterable<int>',
4294 'Object'
4295 ]));
4296 } 4292 }
4297 4293
4298 test_undefinedFunction_create_importType() async { 4294 test_undefinedFunction_create_importType() async {
4299 addSource( 4295 addSource(
4300 '/lib.dart', 4296 '/lib.dart',
4301 r''' 4297 r'''
4302 library lib; 4298 library lib;
4303 import 'dart:async'; 4299 import 'dart:async';
4304 Future getFuture() => null; 4300 Future getFuture() => null;
4305 '''); 4301 ''');
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
4924 _assertLinkedGroup( 4920 _assertLinkedGroup(
4925 change.linkedEditGroups[index++], 4921 change.linkedEditGroups[index++],
4926 ['double d'], 4922 ['double d'],
4927 expectedSuggestions(LinkedEditSuggestionKind.TYPE, 4923 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4928 ['double', 'num', 'Object', 'Comparable<num>'])); 4924 ['double', 'num', 'Object', 'Comparable<num>']));
4929 _assertLinkedGroup(change.linkedEditGroups[index++], ['d,']); 4925 _assertLinkedGroup(change.linkedEditGroups[index++], ['d,']);
4930 _assertLinkedGroup( 4926 _assertLinkedGroup(
4931 change.linkedEditGroups[index++], 4927 change.linkedEditGroups[index++],
4932 ['String s'], 4928 ['String s'],
4933 expectedSuggestions(LinkedEditSuggestionKind.TYPE, 4929 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4934 ['String', 'Object', 'Comparable<String>', 'Pattern'])); 4930 ['String', 'Object', 'Comparable<String>']));
4935 _assertLinkedGroup(change.linkedEditGroups[index++], ['s)']); 4931 _assertLinkedGroup(change.linkedEditGroups[index++], ['s)']);
4936 } 4932 }
4937 4933
4938 test_undefinedMethod_createUnqualified_parameters_named() async { 4934 test_undefinedMethod_createUnqualified_parameters_named() async {
4939 await resolveTestUnit(''' 4935 await resolveTestUnit('''
4940 class A { 4936 class A {
4941 main() { 4937 main() {
4942 myUndefinedMethod(0, bbb: 1.0, ccc: '2'); 4938 myUndefinedMethod(0, bbb: 1.0, ccc: '2');
4943 } 4939 }
4944 } 4940 }
(...skipping 23 matching lines...) Expand all
4968 _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']); 4964 _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']);
4969 _assertLinkedGroup( 4965 _assertLinkedGroup(
4970 change.linkedEditGroups[index++], 4966 change.linkedEditGroups[index++],
4971 ['double bbb'], 4967 ['double bbb'],
4972 expectedSuggestions(LinkedEditSuggestionKind.TYPE, 4968 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4973 ['double', 'num', 'Object', 'Comparable<num>'])); 4969 ['double', 'num', 'Object', 'Comparable<num>']));
4974 _assertLinkedGroup( 4970 _assertLinkedGroup(
4975 change.linkedEditGroups[index++], 4971 change.linkedEditGroups[index++],
4976 ['String ccc'], 4972 ['String ccc'],
4977 expectedSuggestions(LinkedEditSuggestionKind.TYPE, 4973 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4978 ['String', 'Object', 'Comparable<String>', 'Pattern'])); 4974 ['String', 'Object', 'Comparable<String>']));
4979 } 4975 }
4980 4976
4981 test_undefinedMethod_createUnqualified_returnType() async { 4977 test_undefinedMethod_createUnqualified_returnType() async {
4982 await resolveTestUnit(''' 4978 await resolveTestUnit('''
4983 class A { 4979 class A {
4984 main() { 4980 main() {
4985 int v = myUndefinedMethod(); 4981 int v = myUndefinedMethod();
4986 } 4982 }
4987 } 4983 }
4988 '''); 4984 ''');
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
5592 5588
5593 @override 5589 @override
5594 final CompilationUnit unit; 5590 final CompilationUnit unit;
5595 5591
5596 @override 5592 @override
5597 final AnalysisError error; 5593 final AnalysisError error;
5598 5594
5599 _DartFixContextImpl(this.resourceProvider, this.getTopLevelDeclarations, 5595 _DartFixContextImpl(this.resourceProvider, this.getTopLevelDeclarations,
5600 this.analysisContext, this.unit, this.error); 5596 this.analysisContext, this.unit, this.error);
5601 } 5597 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698