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

Unified Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 1764853002: Quick fix to ignore a specific error (#25915). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixes Created 4 years, 10 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/analysis_server/test/services/correction/fix_test.dart
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index 853a4488837dafc316da747af9ec0f5dcc30426f..c69487ea5bc2bff57f1cee3335b99a47e0ac1894 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -252,6 +252,22 @@ class Test {
''');
}
+ test_addIgnoreWarning() async {
+ resolveTestUnit('''
+main() {
+ int x = ''; //invalid_assignment
+}
+''');
+ await assertHasFix(
+ DartFixKind.IGNORE_ERROR,
+ '''
+main() {
+ //ignore: invalid_assignment
+ int x = ''; //invalid_assignment
+}
+''');
+ }
+
test_addMissingParameter_function_positional_hasNamed() async {
resolveTestUnit('''
test({int a}) {}
@@ -473,6 +489,8 @@ main() {
}
if (error.message == message2) {
List<Fix> fixes = await _computeFixes(error);
+ // remove ignore fix
+ fixes.removeWhere((Fix fix) => fix.kind == DartFixKind.IGNORE_ERROR);
// has exactly one fix
expect(fixes, hasLength(1));
Fix fix = fixes[0];

Powered by Google App Engine
This is Rietveld 408576698