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

Unified Diff: pkg/analysis_server/test/edit/refactoring_test.dart

Issue 1411973006: Covering expression offsets/lengths integration. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698