| 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.integration.analysis.lint; | |
| 6 | |
| 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 5 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 8 import 'package:analyzer/src/generated/engine.dart'; | 6 import 'package:analyzer/src/generated/engine.dart'; |
| 9 import 'package:test/test.dart'; | 7 import 'package:test/test.dart'; |
| 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 11 | 9 |
| 12 import '../integration_tests.dart'; | 10 import '../integration_tests.dart'; |
| 13 | 11 |
| 14 main() { | 12 main() { |
| 15 defineReflectiveSuite(() { | 13 defineReflectiveSuite(() { |
| 16 defineReflectiveTests(LintIntegrationTest); | 14 defineReflectiveTests(LintIntegrationTest); |
| 15 defineReflectiveTests(LintIntegrationTest_Driver); |
| 17 }); | 16 }); |
| 18 } | 17 } |
| 19 | 18 |
| 20 @reflectiveTest | 19 class AbstractLintIntegrationTest |
| 21 class LintIntegrationTest extends AbstractAnalysisServerIntegrationTest { | 20 extends AbstractAnalysisServerIntegrationTest { |
| 22 test_no_lints_when_not_specified() async { | 21 test_no_lints_when_not_specified() async { |
| 23 String source = sourcePath('test.dart'); | 22 String source = sourcePath('test.dart'); |
| 24 writeFile( | 23 writeFile( |
| 25 source, | 24 source, |
| 26 ''' | 25 ''' |
| 27 class abc { // lint: not CamelCase (should get ignored though) | 26 class abc { // lint: not CamelCase (should get ignored though) |
| 28 }'''); | 27 }'''); |
| 29 standardAnalysisSetup(); | 28 standardAnalysisSetup(); |
| 30 | 29 |
| 31 await analysisFinished; | 30 await analysisFinished; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 85 |
| 87 expect(currentAnalysisErrors[source], isList); | 86 expect(currentAnalysisErrors[source], isList); |
| 88 List<AnalysisError> errors = currentAnalysisErrors[source]; | 87 List<AnalysisError> errors = currentAnalysisErrors[source]; |
| 89 expect(errors, hasLength(1)); | 88 expect(errors, hasLength(1)); |
| 90 AnalysisError error = errors[0]; | 89 AnalysisError error = errors[0]; |
| 91 expect(error.location.file, source); | 90 expect(error.location.file, source); |
| 92 expect(error.severity, AnalysisErrorSeverity.INFO); | 91 expect(error.severity, AnalysisErrorSeverity.INFO); |
| 93 expect(error.type, AnalysisErrorType.LINT); | 92 expect(error.type, AnalysisErrorType.LINT); |
| 94 } | 93 } |
| 95 } | 94 } |
| 95 |
| 96 @reflectiveTest |
| 97 class LintIntegrationTest extends AbstractLintIntegrationTest {} |
| 98 |
| 99 @reflectiveTest |
| 100 class LintIntegrationTest_Driver extends AbstractLintIntegrationTest { |
| 101 @override |
| 102 bool get enableNewAnalysisDriver => true; |
| 103 } |
| OLD | NEW |