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 ea55ec18e2cc0a751211f7cb2c699ed714ffdf64..dbfb129d165dc07008bc9e2a35f09455e67c7f4e 100644 |
--- a/pkg/analysis_server/test/services/correction/fix_test.dart |
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart |
@@ -5273,10 +5273,10 @@ class LintFixTest extends BaseFixProcessorTest { |
resultCode = SourceEdit.applySequence(testCode, change.edits[0].edits); |
} |
- void findLint(String src, String lintCode) { |
+ void findLint(String src, String lintCode, {int length: 1}) { |
int errorOffset = src.indexOf('/*LINT*/'); |
resolveTestUnit(src.replaceAll('/*LINT*/', '')); |
- error = new AnalysisError(testUnit.element.source, errorOffset, 1, |
+ error = new AnalysisError(testUnit.element.source, errorOffset, length, |
new LintCode(lintCode, '<ignored>')); |
} |
@@ -5462,6 +5462,23 @@ class Sub extends Test { |
'''); |
} |
+ test_lint_removeInterpolationBraces() async { |
+ String src = r''' |
+main() { |
+ var v = 42; |
+ print('v: /*LINT*/${ v}'); |
+} |
+'''; |
+ findLint(src, LintNames.unnecessary_brace_in_string_interp, length: 4); |
+ await applyFix(DartFixKind.LINT_REMOVE_INTERPOLATION_BRACES); |
+ verifyResult(r''' |
+main() { |
+ var v = 42; |
+ print('v: $v'); |
+} |
+'''); |
+ } |
+ |
void verifyResult(String expectedResult) { |
expect(resultCode, expectedResult); |
} |