Chromium Code Reviews| Index: pkg/analysis_server/test/integration/analysis_error_inttest.dart |
| diff --git a/pkg/analysis_server/test/integration/analysis_error_inttest.dart b/pkg/analysis_server/test/integration/analysis_error_inttest.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..05d3416f590425e046141898b9f56fc43b0e62c3 |
| --- /dev/null |
| +++ b/pkg/analysis_server/test/integration/analysis_error_inttest.dart |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +library test.integration.analysis.error; |
| + |
| +import 'package:analysis_testing/reflective_tests.dart'; |
| +import 'package:unittest/unittest.dart'; |
| + |
| +import 'integration_tests.dart'; |
| + |
| +@ReflectiveTestCase() |
| +class AnalysisErrorIntegrationTest extends AbstractAnalysisServerIntegrationTest |
| + { |
| + test_detect_simple_error() { |
| + createFile('test.dart', |
| + ''' |
| +main() { |
| + var x // parse error: missing ';' |
| +}'''); |
| + setAnalysisRoots(['']); |
| + return analysisFinished.then((_) { |
| + String filePath = normalizePath('test.dart'); |
| + expect(currentAnalysisErrors[filePath], isList); |
| + List errors = currentAnalysisErrors[filePath]; |
| + expect(errors, hasLength(1)); |
| + expect(errors[0], isAnalysisError); |
| + expect(errors[0]['location']['file'], equals(filePath)); |
|
Brian Wilkerson
2014/07/16 14:08:51
Consider adding specialized matcher builders, such
Paul Berry
2014/07/16 16:00:00
Good idea. I will do this in a future CL.
|
| + }); |
| + } |
| +} |
| + |
| +main() { |
| + runReflectiveTests(AnalysisErrorIntegrationTest); |
| +} |