| 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.get.errors; | 5 library test.integration.analysis.get.errors; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:test/test.dart'; | 9 import 'package:test/test.dart'; |
| 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 11 | 11 |
| 12 import '../integration_tests.dart'; | 12 import '../support/integration_tests.dart'; |
| 13 | 13 |
| 14 main() { | 14 main() { |
| 15 defineReflectiveSuite(() { | 15 defineReflectiveSuite(() { |
| 16 defineReflectiveTests(GetErrorsTest); | 16 defineReflectiveTests(GetErrorsTest); |
| 17 }); | 17 }); |
| 18 } | 18 } |
| 19 | 19 |
| 20 @reflectiveTest | 20 @reflectiveTest |
| 21 class GetErrorsTest extends AbstractAnalysisServerIntegrationTest { | 21 class GetErrorsTest extends AbstractAnalysisServerIntegrationTest { |
| 22 test_getErrors() { | 22 test_getErrors() { |
| 23 String pathname = sourcePath('test.dart'); | 23 String pathname = sourcePath('test.dart'); |
| 24 String text = r''' | 24 String text = r''' |
| 25 main() { | 25 main() { |
| 26 var x // parse error: missing ';' | 26 var x // parse error: missing ';' |
| 27 }'''; | 27 }'''; |
| 28 writeFile(pathname, text); | 28 writeFile(pathname, text); |
| 29 standardAnalysisSetup(); | 29 standardAnalysisSetup(); |
| 30 Future finishTest() { | 30 Future finishTest() { |
| 31 return sendAnalysisGetErrors(pathname).then((result) { | 31 return sendAnalysisGetErrors(pathname).then((result) { |
| 32 expect(result.errors, equals(currentAnalysisErrors[pathname])); | 32 expect(result.errors, equals(currentAnalysisErrors[pathname])); |
| 33 }); | 33 }); |
| 34 } | 34 } |
| 35 | 35 |
| 36 return analysisFinished.then((_) => finishTest()); | 36 return analysisFinished.then((_) => finishTest()); |
| 37 } | 37 } |
| 38 } | 38 } |
| OLD | NEW |