| Index: pkg/analyzer/test/generated/compile_time_error_code_test.dart
|
| diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
|
| index 5158c9070561ecbc4d13a94a87a9597667ed963d..e8cc06876c80d9cac982fa4da7585cdc3dc2ed5c 100644
|
| --- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
|
| +++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
|
| @@ -1120,6 +1120,35 @@ const C = a.m;''');
|
| verify([source]);
|
| }
|
|
|
| + test_constEvalThrowsException_assertInitializer_false() async {
|
| + resetWith(
|
| + options: new AnalysisOptionsImpl()..enableAssertInitializer = true);
|
| + Source source = addSource(r'''
|
| +class A {
|
| + const A(int p) : assert(p != 0);
|
| +}
|
| +const a = const A(0);
|
| +''');
|
| + await computeAnalysisResult(source);
|
| + assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_ASSERT_FALSE]);
|
| + verify([source]);
|
| + }
|
| +
|
| + test_constEvalThrowsException_assertInitializer_notBool() async {
|
| + resetWith(
|
| + options: new AnalysisOptionsImpl()..enableAssertInitializer = true);
|
| + Source source = addSource(r'''
|
| +class A<T> {
|
| + const A(T p) : assert(p);
|
| +}
|
| +const a = const A(0);
|
| +''');
|
| + await computeAnalysisResult(source);
|
| + assertErrors(
|
| + source, [CompileTimeErrorCode.CONST_EVAL_THROWS_ASSERT_NOT_BOOL]);
|
| + verify([source]);
|
| + }
|
| +
|
| test_constEvalThrowsException_binaryMinus_null() async {
|
| await _check_constEvalThrowsException_binary_null("null - 5", false);
|
| await _check_constEvalThrowsException_binary_null("5 - null", true);
|
|
|