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