Index: pkg/analysis_server/test/edit/refactoring_test.dart |
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart |
index c1011eec093cdc0d02a194e8d6800e88562d3576..fcb0568a311714643411409b94b2cfb470afc419 100644 |
--- a/pkg/analysis_server/test/edit/refactoring_test.dart |
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart |
@@ -275,6 +275,26 @@ class ExtractLocalVariableTest extends _AbstractGetRefactoring_Test { |
super.tearDown(); |
} |
+ test_coveringExpressions() { |
+ addTestFile(''' |
+main() { |
+ var v = 111 + 222 + 333; |
+} |
+'''); |
+ return getRefactoringResult(() { |
+ return sendExtractRequest(testCode.indexOf('222 +'), 0, 'res', true); |
+ }).then((result) { |
+ ExtractLocalVariableFeedback feedback = result.feedback; |
+ expect(feedback.coveringExpressionOffsets, [ |
+ testCode.indexOf('222 +'), |
+ testCode.indexOf('111 +'), |
+ testCode.indexOf('111 +') |
+ ]); |
+ expect(feedback.coveringExpressionLengths, |
+ ['222'.length, '111 + 222'.length, '111 + 222 + 333'.length]); |
+ }); |
+ } |
+ |
test_extractAll() { |
addTestFile(''' |
main() { |