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

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

Issue 1255953004: better completions in switch statements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 4 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_test_util.dart
diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
index 249e1c03a36d3828edb6c6ace4ef987a1fcc76f4..ef721e0a0561e368b3444de3bbed562c23180e42 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -3986,6 +3986,35 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
+ test_SwitchStatement_c() {
+ // SwitchStatement Block BlockFunctionBody MethodDeclaration
+ addTestSource('class A {String g(int x) {switch(x) {c^}}}');
+ computeFast();
+ return computeFull((bool result) {
+ assertNoSuggestions();
+ });
+ }
+
+ test_SwitchStatement_case() {
+ // SwitchStatement Block BlockFunctionBody MethodDeclaration
+ addTestSource('class A {String g(int x) {switch(x) {case 0: ^}}}');
+ computeFast();
+ return computeFull((bool result) {
+ assertSuggestLocalClass('A');
+ assertSuggestLocalMethod('g', 'A', 'String');
+ assertSuggestImportedClass('String');
+ });
+ }
+
+ test_SwitchStatement_empty() {
+ // SwitchStatement Block BlockFunctionBody MethodDeclaration
+ addTestSource('class A {String g(int x) {switch(x) {^}}}');
+ computeFast();
+ return computeFull((bool result) {
+ assertNoSuggestions();
+ });
+ }
+
test_ThisExpression_block() {
// MethodInvocation ExpressionStatement Block
addTestSource('''

Powered by Google App Engine
This is Rietveld 408576698