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

Unified Diff: pkg/analysis_server/test/services/refactoring/extract_local_test.dart

Issue 1522193002: Issue 25251. Fix for extracting string literal part with zero length. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/test/edit/refactoring_test.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/services/refactoring/extract_local_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
index cae09e7999dc7128f9fff5aafacddb4c519d4db7..9903a1d59bd20ba49856cc1c837adffe57311329 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
@@ -960,6 +960,22 @@ main() {
''');
}
+ test_singleExpression_string() {
+ indexTestUnit('''
+void main() {
+ print("1234");
+}
+''');
+ _createRefactoringAtString('34"');
+ // apply refactoring
+ return _assertSuccessfulRefactoring('''
+void main() {
+ var res = "1234";
+ print(res);
+}
+''');
+ }
+
test_singleExpression_trailingNotWhitespace() {
indexTestUnit('''
main() {
@@ -1093,6 +1109,16 @@ main() {
}
/**
+ * Creates a new refactoring in [refactoring] at the offset of the given
+ * [search] pattern, and with the length `0`.
+ */
+ void _createRefactoringAtString(String search) {
+ int offset = findOffset(search);
+ int length = 0;
+ _createRefactoring(offset, length);
+ }
+
+ /**
* Creates a new refactoring in [refactoring] for the selection range of the
* given [search] pattern.
*/
« no previous file with comments | « pkg/analysis_server/test/edit/refactoring_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698