| 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/edit/fix/fix_core.dart'; | 7 import 'package:analysis_server/edit/fix/fix_core.dart'; |
| 8 import 'package:analysis_server/src/protocol.dart' hide AnalysisError; | 8 import 'package:analysis_server/src/protocol.dart' hide AnalysisError; |
| 9 import 'package:analysis_server/src/services/correction/fix.dart'; | 9 import 'package:analysis_server/src/services/correction/fix.dart'; |
| 10 import 'package:analysis_server/src/services/correction/fix_internal.dart'; | 10 import 'package:analysis_server/src/services/correction/fix_internal.dart'; |
| 11 import 'package:analyzer/file_system/file_system.dart'; | 11 import 'package:analyzer/file_system/file_system.dart'; |
| 12 import 'package:analyzer/source/package_map_resolver.dart'; | 12 import 'package:analyzer/source/package_map_resolver.dart'; |
| 13 import 'package:analyzer/src/generated/error.dart'; | 13 import 'package:analyzer/src/generated/error.dart'; |
| 14 import 'package:analyzer/src/generated/parser.dart'; | 14 import 'package:analyzer/src/generated/parser.dart'; |
| 15 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
| 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 16 import 'package:unittest/unittest.dart'; | 17 import 'package:unittest/unittest.dart'; |
| 17 | 18 |
| 18 import '../../abstract_context.dart'; | 19 import '../../abstract_context.dart'; |
| 19 import '../../abstract_single_unit.dart'; | 20 import '../../abstract_single_unit.dart'; |
| 20 import '../../reflective_tests.dart'; | |
| 21 | 21 |
| 22 main() { | 22 main() { |
| 23 groupSep = ' | '; | 23 groupSep = ' | '; |
| 24 runReflectiveTests(FixProcessorTest); | 24 defineReflectiveTests(FixProcessorTest); |
| 25 } | 25 } |
| 26 | 26 |
| 27 typedef bool AnalysisErrorFilter(AnalysisError error); | 27 typedef bool AnalysisErrorFilter(AnalysisError error); |
| 28 | 28 |
| 29 @reflectiveTest | 29 @reflectiveTest |
| 30 class FixProcessorTest extends AbstractSingleUnitTest { | 30 class FixProcessorTest extends AbstractSingleUnitTest { |
| 31 AnalysisErrorFilter errorFilter = (AnalysisError error) { | 31 AnalysisErrorFilter errorFilter = (AnalysisError error) { |
| 32 return error.errorCode != HintCode.UNUSED_CATCH_CLAUSE && | 32 return error.errorCode != HintCode.UNUSED_CATCH_CLAUSE && |
| 33 error.errorCode != HintCode.UNUSED_CATCH_STACK && | 33 error.errorCode != HintCode.UNUSED_CATCH_STACK && |
| 34 error.errorCode != HintCode.UNUSED_ELEMENT && | 34 error.errorCode != HintCode.UNUSED_ELEMENT && |
| (...skipping 3504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3539 | 3539 |
| 3540 List<Position> _findResultPositions(List<String> searchStrings) { | 3540 List<Position> _findResultPositions(List<String> searchStrings) { |
| 3541 List<Position> positions = <Position>[]; | 3541 List<Position> positions = <Position>[]; |
| 3542 for (String search in searchStrings) { | 3542 for (String search in searchStrings) { |
| 3543 int offset = resultCode.indexOf(search); | 3543 int offset = resultCode.indexOf(search); |
| 3544 positions.add(new Position(testFile, offset)); | 3544 positions.add(new Position(testFile, offset)); |
| 3545 } | 3545 } |
| 3546 return positions; | 3546 return positions; |
| 3547 } | 3547 } |
| 3548 } | 3548 } |
| OLD | NEW |