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

Side by Side Diff: pkg/analysis_server/test/edit/fixes_test.dart

Issue 556573002: Make SdkLibrary.shortName consistently include 'dart:' (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
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.edit.fixes; 5 library test.edit.fixes;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/edit/edit_domain.dart'; 9 import 'package:analysis_server/src/edit/edit_domain.dart';
10 import 'package:analysis_server/src/protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
(...skipping 11 matching lines...) Expand all
22 22
23 @ReflectiveTestCase() 23 @ReflectiveTestCase()
24 class FixesTest extends AbstractAnalysisTest { 24 class FixesTest extends AbstractAnalysisTest {
25 @override 25 @override
26 void setUp() { 26 void setUp() {
27 super.setUp(); 27 super.setUp();
28 createProject(); 28 createProject();
29 handler = new EditDomainHandler(server); 29 handler = new EditDomainHandler(server);
30 } 30 }
31 31
32 Future test_fixUndefinedClass() {
33 addTestFile('''
34 main() {
35 Future<String> x = null;
36 }
37 ''');
38 return waitForTasksFinished().then((_) {
39 List<AnalysisErrorFixes> errorFixes = _getFixesAt('Future<String>');
40 expect(errorFixes, hasLength(1));
41 AnalysisError error = errorFixes[0].error;
42 expect(error.severity, AnalysisErrorSeverity.WARNING);
43 expect(error.type, AnalysisErrorType.STATIC_WARNING);
44 List<SourceChange> fixes = errorFixes[0].fixes;
45 expect(fixes, hasLength(2));
46 expect(fixes[0].message, matches('Import library'));
47 expect(fixes[1].message, matches('Create class'));
48 });
49 }
50
32 Future test_hasFixes() { 51 Future test_hasFixes() {
33 addTestFile(''' 52 addTestFile('''
34 foo() { 53 foo() {
35 print(1) 54 print(1)
36 } 55 }
37 bar() { 56 bar() {
38 print(10) print(20) 57 print(10) print(20)
39 } 58 }
40 '''); 59 ''');
41 return waitForTasksFinished().then((_) { 60 return waitForTasksFinished().then((_) {
(...skipping 26 matching lines...) Expand all
68 } 87 }
69 88
70 89
71 List<AnalysisErrorFixes> _getFixes(int offset) { 90 List<AnalysisErrorFixes> _getFixes(int offset) {
72 Request request = new EditGetFixesParams(testFile, offset).toRequest('0'); 91 Request request = new EditGetFixesParams(testFile, offset).toRequest('0');
73 Response response = handleSuccessfulRequest(request); 92 Response response = handleSuccessfulRequest(request);
74 var result = new EditGetFixesResult.fromResponse(response); 93 var result = new EditGetFixesResult.fromResponse(response);
75 return result.fixes; 94 return result.fixes;
76 } 95 }
77 } 96 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | pkg/analysis_server/test/mock_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698