| OLD | NEW |
| 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 3442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3453 DartFixKind.IMPORT_LIBRARY_SDK, | 3453 DartFixKind.IMPORT_LIBRARY_SDK, |
| 3454 ''' | 3454 ''' |
| 3455 import 'dart:math'; | 3455 import 'dart:math'; |
| 3456 | 3456 |
| 3457 @PI | 3457 @PI |
| 3458 main() { | 3458 main() { |
| 3459 } | 3459 } |
| 3460 '''); | 3460 '''); |
| 3461 } | 3461 } |
| 3462 | 3462 |
| 3463 test_importLibraryShow() async { | 3463 test_importLibraryShow_project() async { |
| 3464 testFile = '/project/bin/test.dart'; |
| 3465 addSource( |
| 3466 '/project/bin/lib.dart', |
| 3467 ''' |
| 3468 class A {} |
| 3469 class B {} |
| 3470 '''); |
| 3471 resolveTestUnit(''' |
| 3472 import 'lib.dart' show A; |
| 3473 main() { |
| 3474 A a; |
| 3475 B b; |
| 3476 } |
| 3477 '''); |
| 3478 performAllAnalysisTasks(); |
| 3479 await assertNoFix(DartFixKind.IMPORT_LIBRARY_PROJECT); |
| 3480 await assertHasFix( |
| 3481 DartFixKind.IMPORT_LIBRARY_SHOW, |
| 3482 ''' |
| 3483 import 'lib.dart' show A, B; |
| 3484 main() { |
| 3485 A a; |
| 3486 B b; |
| 3487 } |
| 3488 '''); |
| 3489 } |
| 3490 |
| 3491 test_importLibraryShow_sdk() async { |
| 3464 resolveTestUnit(''' | 3492 resolveTestUnit(''' |
| 3465 import 'dart:async' show Stream; | 3493 import 'dart:async' show Stream; |
| 3466 main() { | 3494 main() { |
| 3467 Stream s = null; | 3495 Stream s = null; |
| 3468 Future f = null; | 3496 Future f = null; |
| 3469 } | 3497 } |
| 3470 '''); | 3498 '''); |
| 3499 await assertNoFix(DartFixKind.IMPORT_LIBRARY_SDK); |
| 3471 await assertHasFix( | 3500 await assertHasFix( |
| 3472 DartFixKind.IMPORT_LIBRARY_SHOW, | 3501 DartFixKind.IMPORT_LIBRARY_SHOW, |
| 3473 ''' | 3502 ''' |
| 3474 import 'dart:async' show Future, Stream; | 3503 import 'dart:async' show Future, Stream; |
| 3475 main() { | 3504 main() { |
| 3476 Stream s = null; | 3505 Stream s = null; |
| 3477 Future f = null; | 3506 Future f = null; |
| 3478 } | 3507 } |
| 3479 '''); | 3508 '''); |
| 3480 } | 3509 } |
| (...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5284 @override | 5313 @override |
| 5285 void t() { } | 5314 void t() { } |
| 5286 } | 5315 } |
| 5287 '''); | 5316 '''); |
| 5288 } | 5317 } |
| 5289 | 5318 |
| 5290 void verifyResult(String expectedResult) { | 5319 void verifyResult(String expectedResult) { |
| 5291 expect(resultCode, expectedResult); | 5320 expect(resultCode, expectedResult); |
| 5292 } | 5321 } |
| 5293 } | 5322 } |
| OLD | NEW |