| 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 62d525e9bd70bf93cb18011804d774354fd2cd64..ec43f49335dce2b10ec9c7071c63392c9e11894f 100644
|
| --- a/pkg/analyzer/test/generated/error_suppression_test.dart
|
| +++ b/pkg/analyzer/test/generated/error_suppression_test.dart
|
| @@ -195,4 +195,35 @@ const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
| CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
| ]);
|
| }
|
| +
|
| + test_ignore_for_file() async {
|
| + Source source = addSource('''
|
| +int x = ''; //INVALID_ASSIGNMENT
|
| +const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
| +// ignore_for_file: invalid_assignment
|
| +''');
|
| + await computeAnalysisResult(source);
|
| + assertErrors(source,
|
| + [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
|
| + }
|
| +
|
| + test_multiple_ignore_for_files() async {
|
| + Source source = addSource('''
|
| +int x = ''; //INVALID_ASSIGNMENT
|
| +const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
| +// ignore_for_file: invalid_assignment,const_initialized_with_non_constant_value
|
| +''');
|
| + await computeAnalysisResult(source);
|
| + assertErrors(source, []);
|
| + }
|
| +
|
| + test_ignore_for_file_whitespace_variant() async {
|
| + Source source = addSource('''
|
| +//ignore_for_file: const_initialized_with_non_constant_value , invalid_assignment
|
| +int x = ''; //INVALID_ASSIGNMENT
|
| +const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
| +''');
|
| + await computeAnalysisResult(source);
|
| + assertErrors(source, []);
|
| + }
|
| }
|
|
|