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.analysis.reanalyze; | 5 library test.analysis.reanalyze; |
6 | 6 |
7 import 'package:analysis_server/src/constants.dart'; | 7 import 'package:analysis_server/src/constants.dart'; |
8 import 'package:analysis_server/src/protocol.dart'; | 8 import 'package:analysis_server/src/protocol.dart'; |
9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 server.updateContent('1', {testFile: new AddContentOverlay('main() {')}); | 52 server.updateContent('1', {testFile: new AddContentOverlay('main() {')}); |
53 return waitForTasksFinished(); | 53 return waitForTasksFinished(); |
54 }).then((_) { | 54 }).then((_) { |
55 // Verify that the syntax error was detected. | 55 // Verify that the syntax error was detected. |
56 List<AnalysisError> errors = filesErrors[testFile]; | 56 List<AnalysisError> errors = filesErrors[testFile]; |
57 expect(errors, hasLength(1)); | 57 expect(errors, hasLength(1)); |
58 // Remove testFile from filesErrors so that we'll notice when the file is | 58 // Remove testFile from filesErrors so that we'll notice when the file is |
59 // re-analyzed. | 59 // re-analyzed. |
60 filesErrors.remove(testFile); | 60 filesErrors.remove(testFile); |
61 // Reanalyze. | 61 // Reanalyze. |
62 server.reanalyze(); | 62 server.reanalyze(null); |
63 return waitForTasksFinished(); | 63 return waitForTasksFinished(); |
64 }).then((_) { | 64 }).then((_) { |
65 // The file should have been reanalyzed. | 65 // The file should have been reanalyzed. |
66 expect(filesErrors, contains(testFile)); | 66 expect(filesErrors, contains(testFile)); |
67 // Verify that the syntax error is present (this indicates that the | 67 // Verify that the syntax error is present (this indicates that the |
68 // content introduced by the call to updateContent is still in effect). | 68 // content introduced by the call to updateContent is still in effect). |
69 List<AnalysisError> errors = filesErrors[testFile]; | 69 List<AnalysisError> errors = filesErrors[testFile]; |
70 expect(errors, hasLength(1)); | 70 expect(errors, hasLength(1)); |
71 }); | 71 }); |
72 } | 72 } |
73 } | 73 } |
OLD | NEW |