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

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

Issue 2546993004: Issue 27820. Add fix for CompileTimeErrorCode.UNDEFINED_CLASS. (Closed)
Patch Set: Created 4 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 unified diff | 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 »
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 '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 3153 matching lines...) Expand 10 before | Expand all | Expand 10 after
3164 DartFixKind.IMPORT_LIBRARY_PROJECT1, 3164 DartFixKind.IMPORT_LIBRARY_PROJECT1,
3165 ''' 3165 '''
3166 import 'lib.dart'; 3166 import 'lib.dart';
3167 3167
3168 @Test(0) 3168 @Test(0)
3169 main() { 3169 main() {
3170 } 3170 }
3171 '''); 3171 ''');
3172 } 3172 }
3173 3173
3174 test_importLibraryProject_withClass_constInstanceCreation() async {
3175 addSource(
3176 '/lib.dart',
3177 '''
3178 class Test {
3179 const Test();
3180 }
3181 ''');
3182 resolveTestUnit('''
3183 main() {
3184 const Test();
3185 }
3186 ''');
3187 performAllAnalysisTasks();
3188 await assertHasFix(
3189 DartFixKind.IMPORT_LIBRARY_PROJECT1,
3190 '''
3191 import 'lib.dart';
3192
3193 main() {
3194 const Test();
3195 }
3196 ''');
3197 }
3198
3174 test_importLibraryProject_withClass_hasOtherLibraryWithPrefix() async { 3199 test_importLibraryProject_withClass_hasOtherLibraryWithPrefix() async {
3175 testFile = '/project/bin/test.dart'; 3200 testFile = '/project/bin/test.dart';
3176 addSource( 3201 addSource(
3177 '/project/bin/a.dart', 3202 '/project/bin/a.dart',
3178 ''' 3203 '''
3179 library a; 3204 library a;
3180 class One {} 3205 class One {}
3181 '''); 3206 ''');
3182 addSource( 3207 addSource(
3183 '/project/bin/b.dart', 3208 '/project/bin/b.dart',
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after
5478 var v = 42; 5503 var v = 42;
5479 print('v: $v'); 5504 print('v: $v');
5480 } 5505 }
5481 '''); 5506 ''');
5482 } 5507 }
5483 5508
5484 void verifyResult(String expectedResult) { 5509 void verifyResult(String expectedResult) {
5485 expect(resultCode, expectedResult); 5510 expect(resultCode, expectedResult);
5486 } 5511 }
5487 } 5512 }
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