Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: pkg/analyzer/test/generated/error_suppression_test.dart

Issue 2933753002: Run the sorter to reduce code churn (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 ec43f49335dce2b10ec9c7071c63392c9e11894f..bbed7005d467c0164ce30bc95841353ac2040439 100644
--- a/pkg/analyzer/test/generated/error_suppression_test.dart
+++ b/pkg/analyzer/test/generated/error_suppression_test.dart
@@ -53,6 +53,27 @@ 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_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, []);
+ }
+
test_ignore_only_trailing() async {
Source source = addSource('''
int x = ''; // ignore: invalid_assignment
@@ -135,6 +156,16 @@ const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
}
+ 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_multiple_ignores() async {
Source source = addSource('''
int x = 3;
@@ -195,35 +226,4 @@ 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, []);
- }
}
« no previous file with comments | « pkg/analyzer/test/generated/compile_time_error_code_test.dart ('k') | pkg/analyzer/test/generated/gn_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698