OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:analysis_server/protocol/protocol_generated.dart'; | 5 import 'package:analysis_server/protocol/protocol_generated.dart'; |
6 import 'package:test/test.dart'; | 6 import 'package:test/test.dart'; |
7 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
8 | 8 |
9 import '../support/integration_tests.dart'; | 9 import '../support/integration_tests.dart'; |
10 | 10 |
11 main() { | 11 main() { |
12 defineReflectiveSuite(() { | 12 defineReflectiveSuite(() { |
13 defineReflectiveTests(UpdateOptionsTest); | 13 defineReflectiveTests(UpdateOptionsTest); |
14 }); | 14 }); |
15 } | 15 } |
16 | 16 |
17 @reflectiveTest | 17 @reflectiveTest |
18 class UpdateOptionsTest extends AbstractAnalysisServerIntegrationTest { | 18 class UpdateOptionsTest extends AbstractAnalysisServerIntegrationTest { |
19 @failingTest | 19 @failingTest |
20 test_options() async { | 20 test_options() async { |
21 // We fail after the first analysis.updateOptions - we should not see a hint | 21 // We fail after the first analysis.updateOptions - we should not see a hint |
22 // for the unused import (#28800). | 22 // for the unused import (#28800). |
23 String pathname = sourcePath('test.dart'); | 23 String pathname = sourcePath('test.dart'); |
24 writeFile( | 24 writeFile(pathname, ''' |
25 pathname, | |
26 ''' | |
27 import 'dart:async'; // unused | 25 import 'dart:async'; // unused |
28 | 26 |
29 class Foo { | 27 class Foo { |
30 void bar() {} | 28 void bar() {} |
31 } | 29 } |
32 '''); | 30 '''); |
33 standardAnalysisSetup(); | 31 standardAnalysisSetup(); |
34 | 32 |
35 // ignore: deprecated_member_use | 33 // ignore: deprecated_member_use |
36 await sendAnalysisUpdateOptions( | 34 await sendAnalysisUpdateOptions( |
37 new AnalysisOptions()..generateHints = false); | 35 new AnalysisOptions()..generateHints = false); |
38 await sendAnalysisReanalyze(); | 36 await sendAnalysisReanalyze(); |
39 await analysisFinished; | 37 await analysisFinished; |
40 expect(getErrors(pathname), isEmpty); | 38 expect(getErrors(pathname), isEmpty); |
41 | 39 |
42 // ignore: deprecated_member_use | 40 // ignore: deprecated_member_use |
43 await sendAnalysisUpdateOptions( | 41 await sendAnalysisUpdateOptions( |
44 new AnalysisOptions()..generateHints = true); | 42 new AnalysisOptions()..generateHints = true); |
45 await sendAnalysisReanalyze(); | 43 await sendAnalysisReanalyze(); |
46 await analysisFinished; | 44 await analysisFinished; |
47 expect(getErrors(pathname), hasLength(1)); | 45 expect(getErrors(pathname), hasLength(1)); |
48 } | 46 } |
49 } | 47 } |
OLD | NEW |