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 'package:analysis_server/plugin/edit/fix/fix_core.dart'; | 7 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; |
8 import 'package:analysis_server/plugin/protocol/protocol.dart' | 8 import 'package:analysis_server/plugin/protocol/protocol.dart' |
9 hide AnalysisError; | 9 hide AnalysisError; |
10 import 'package:analysis_server/src/services/correction/fix.dart'; | 10 import 'package:analysis_server/src/services/correction/fix.dart'; |
(...skipping 3280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3291 | 3291 |
3292 void test_removeUnnecessaryCast_assignment() { | 3292 void test_removeUnnecessaryCast_assignment() { |
3293 resolveTestUnit(''' | 3293 resolveTestUnit(''' |
3294 main(Object p) { | 3294 main(Object p) { |
3295 if (p is String) { | 3295 if (p is String) { |
3296 String v = ((p as String)); | 3296 String v = ((p as String)); |
3297 } | 3297 } |
3298 } | 3298 } |
3299 '''); | 3299 '''); |
3300 assertHasFix( | 3300 assertHasFix( |
3301 DartFixKind.REMOVE_UNNECASSARY_CAST, | 3301 DartFixKind.REMOVE_UNNECESSARY_CAST, |
3302 ''' | 3302 ''' |
3303 main(Object p) { | 3303 main(Object p) { |
3304 if (p is String) { | 3304 if (p is String) { |
3305 String v = p; | 3305 String v = p; |
3306 } | 3306 } |
3307 } | 3307 } |
3308 '''); | 3308 '''); |
3309 } | 3309 } |
3310 | 3310 |
3311 void test_removeUnusedCatchClause() { | 3311 void test_removeUnusedCatchClause() { |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4613 int offset = resultCode.indexOf(search); | 4613 int offset = resultCode.indexOf(search); |
4614 positions.add(new Position(testFile, offset)); | 4614 positions.add(new Position(testFile, offset)); |
4615 } | 4615 } |
4616 return positions; | 4616 return positions; |
4617 } | 4617 } |
4618 | 4618 |
4619 void _performAnalysis() { | 4619 void _performAnalysis() { |
4620 while (context.performAnalysisTask().hasMoreWork); | 4620 while (context.performAnalysisTask().hasMoreWork); |
4621 } | 4621 } |
4622 } | 4622 } |
OLD | NEW |