| 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.error; | 5 library test.integration.analysis.error; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 | 9 |
| 10 import '../../reflective_tests.dart'; | 10 import '../../reflective_tests.dart'; |
| 11 import '../integration_tests.dart'; | 11 import '../integration_tests.dart'; |
| 12 | 12 |
| 13 main() { | 13 main() { |
| 14 runReflectiveTests(AnalysisErrorIntegrationTest); | 14 runReflectiveTests(AnalysisErrorIntegrationTest); |
| 15 } | 15 } |
| 16 | 16 |
| 17 @ReflectiveTestCase() | 17 @reflectiveTest |
| 18 class AnalysisErrorIntegrationTest extends AbstractAnalysisServerIntegrationTest | 18 class AnalysisErrorIntegrationTest extends AbstractAnalysisServerIntegrationTest |
| 19 { | 19 { |
| 20 test_detect_simple_error() { | 20 test_detect_simple_error() { |
| 21 String pathname = sourcePath('test.dart'); | 21 String pathname = sourcePath('test.dart'); |
| 22 writeFile(pathname, ''' | 22 writeFile(pathname, ''' |
| 23 main() { | 23 main() { |
| 24 print(null) // parse error: missing ';' | 24 print(null) // parse error: missing ';' |
| 25 }'''); | 25 }'''); |
| 26 standardAnalysisSetup(); | 26 standardAnalysisSetup(); |
| 27 return analysisFinished.then((_) { | 27 return analysisFinished.then((_) { |
| 28 expect(currentAnalysisErrors[pathname], isList); | 28 expect(currentAnalysisErrors[pathname], isList); |
| 29 List<AnalysisError> errors = currentAnalysisErrors[pathname]; | 29 List<AnalysisError> errors = currentAnalysisErrors[pathname]; |
| 30 expect(errors, hasLength(1)); | 30 expect(errors, hasLength(1)); |
| 31 expect(errors[0].location.file, equals(pathname)); | 31 expect(errors[0].location.file, equals(pathname)); |
| 32 }); | 32 }); |
| 33 } | 33 } |
| 34 } | 34 } |
| OLD | NEW |