| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 expect(testContext.analysisOptions.lint, true); | 289 expect(testContext.analysisOptions.lint, true); |
| 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 warning and an error. | 299 // Should produce a type warning. |
| 300 expect( | 300 expect( |
| 301 errors.map((error) => error.type), | 301 errors.map((error) => error.type), |
| 302 unorderedEquals([ | 302 unorderedEquals([ |
| 303 AnalysisErrorType.STATIC_TYPE_WARNING, | 303 AnalysisErrorType.STATIC_TYPE_WARNING |
| 304 AnalysisErrorType.COMPILE_TIME_ERROR | |
| 305 ])); | 304 ])); |
| 306 } else { | 305 } else { |
| 307 // Should only produce a hint. | 306 // Should only produce a hint. |
| 308 expect(errors.map((error) => error.type), | 307 expect(errors.map((error) => error.type), |
| 309 unorderedEquals([AnalysisErrorType.HINT])); | 308 unorderedEquals([AnalysisErrorType.HINT])); |
| 310 } | 309 } |
| 311 } | 310 } |
| 312 } | 311 } |
| OLD | NEW |