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

Unified Diff: pkg/analysis_server/test/services/completion/completion_target_test.dart

Issue 1271723002: fix completion replacement offset/length for invalid token in switch statement (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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/completion/completion_target_test.dart
diff --git a/pkg/analysis_server/test/services/completion/completion_target_test.dart b/pkg/analysis_server/test/services/completion/completion_target_test.dart
index 57fb4e93985bc831e687e59de6d0c10c0d6493f1..072f97c32317419c968ae4df63c80f626658a2a0 100644
--- a/pkg/analysis_server/test/services/completion/completion_target_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_target_test.dart
@@ -498,6 +498,30 @@ class C2 {
assertTarget('zoo', 'zoo(z) {}');
}
+ test_SwitchStatement_c() {
+ // Token('c') SwitchStatement
+ addTestSource('main() { switch(x) {c^} }');
+ assertTarget('}', 'switch (x) {}');
+ }
+
+ test_SwitchStatement_c2() {
+ // Token('c') SwitchStatement
+ addTestSource('main() { switch(x) { c^ } }');
+ assertTarget('}', 'switch (x) {}');
+ }
+
+ test_SwitchStatement_empty() {
+ // SwitchStatement
+ addTestSource('main() { switch(x) {^} }');
+ assertTarget('}', 'switch (x) {}');
+ }
+
+ test_SwitchStatement_empty2() {
+ // SwitchStatement
+ addTestSource('main() { switch(x) { ^ } }');
+ assertTarget('}', 'switch (x) {}');
+ }
+
test_TypeArgumentList() {
// TypeName TypeArgumentList TypeName
addTestSource('main() { C<^> c; }');

Powered by Google App Engine
This is Rietveld 408576698