| Index: pkg/analyzer/test/generated/error_suppression_test.dart
|
| diff --git a/pkg/analyzer/test/generated/error_suppression_test.dart b/pkg/analyzer/test/generated/error_suppression_test.dart
|
| index c77bb3d3c48a5c967df3f67c652c7ba12b7f58c8..275e94ccc54468a5fdb35f8bda42547aaf2687eb 100644
|
| --- a/pkg/analyzer/test/generated/error_suppression_test.dart
|
| +++ b/pkg/analyzer/test/generated/error_suppression_test.dart
|
| @@ -42,6 +42,25 @@ const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
| [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
|
| }
|
|
|
| + void test_ignore_first_trailing() {
|
| + Source source = addSource('''
|
| +int x = ''; // ignore: invalid_assignment
|
| +// ... but no ignore here ...
|
| +const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
| +''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source,
|
| + [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
|
| + }
|
| +
|
| + void test_ignore_only_trailing() {
|
| + Source source = addSource('''
|
| +int x = ''; // ignore: invalid_assignment
|
| +''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, []);
|
| + }
|
| +
|
| void test_ignore_second() {
|
| Source source = addSource('''
|
| //INVALID_ASSIGNMENT
|
| @@ -53,6 +72,16 @@ const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
| assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
|
| }
|
|
|
| + void test_ignore_second_trailing() {
|
| + Source source = addSource('''
|
| +//INVALID_ASSIGNMENT
|
| +int x = '';
|
| +const y = x; // ignore: const_initialized_with_non_constant_value
|
| +''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
|
| + }
|
| +
|
| void test_invalid_error_code() {
|
| Source source = addSource('''
|
| // ignore: right_format_wrong_code
|
| @@ -108,6 +137,15 @@ const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VA
|
| assertErrors(source, []);
|
| }
|
|
|
| + void test_multiple_ignores_traling() {
|
| + Source source = addSource('''
|
| +int x = 3;
|
| +const String y = x; // ignore: invalid_assignment, const_initialized_with_non_constant_value
|
| +''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, []);
|
| + }
|
| +
|
| void test_multiple_ignores_whitespace_variant_1() {
|
| Source source = addSource('''
|
| int x = 3;
|
|
|