| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.notification.analysis_options; | 5 library test.analysis.notification.analysis_options; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/src/constants.dart'; | 8 import 'package:analysis_server/src/constants.dart'; |
| 9 import 'package:analysis_server/src/domain_analysis.dart'; | 9 import 'package:analysis_server/src/domain_analysis.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 var rules = getLints(testContext).map((rule) => rule.name); | 290 var rules = getLints(testContext).map((rule) => rule.name); |
| 291 expect(rules, unorderedEquals(lints)); | 291 expect(rules, unorderedEquals(lints)); |
| 292 } | 292 } |
| 293 | 293 |
| 294 verifyStrongMode({bool enabled}) { | 294 verifyStrongMode({bool enabled}) { |
| 295 // Verify strong-mode enabled. | 295 // Verify strong-mode enabled. |
| 296 expect(testContext.analysisOptions.strongMode, enabled); | 296 expect(testContext.analysisOptions.strongMode, enabled); |
| 297 | 297 |
| 298 if (enabled) { | 298 if (enabled) { |
| 299 // Should produce a type warning. | 299 // Should produce a type warning. |
| 300 expect( | 300 expect(errors.map((error) => error.type), |
| 301 errors.map((error) => error.type), | 301 unorderedEquals([AnalysisErrorType.STATIC_TYPE_WARNING])); |
| 302 unorderedEquals([ | |
| 303 AnalysisErrorType.STATIC_TYPE_WARNING | |
| 304 ])); | |
| 305 } else { | 302 } else { |
| 306 // Should only produce a hint. | 303 // Should only produce a hint. |
| 307 expect(errors.map((error) => error.type), | 304 expect(errors.map((error) => error.type), |
| 308 unorderedEquals([AnalysisErrorType.HINT])); | 305 unorderedEquals([AnalysisErrorType.HINT])); |
| 309 } | 306 } |
| 310 } | 307 } |
| 311 } | 308 } |
| OLD | NEW |