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

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

Issue 812593008: Completion support for loop labels. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix problems with toplevel variables. Created 5 years, 11 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
« no previous file with comments | « pkg/analysis_server/test/services/completion/local_computer_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/completion/optype_test.dart
diff --git a/pkg/analysis_server/test/services/completion/optype_test.dart b/pkg/analysis_server/test/services/completion/optype_test.dart
index 254695d2b6bc82c1170644c9b7a7271674902ef0..eb84c6ca50bb2fc358fc905050e4d12490ff03f9 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -44,11 +44,12 @@ class OpTypeTest {
}
void assertOpType({bool invocation: false, bool returnValue: false,
- bool typeNames: false, bool voidReturn: false}) {
+ bool typeNames: false, bool voidReturn: false, bool statementLabel: false}) {
expect(visitor.includeInvocationSuggestions, equals(invocation));
expect(visitor.includeReturnValueSuggestions, equals(returnValue));
expect(visitor.includeTypeNameSuggestions, equals(typeNames));
expect(visitor.includeVoidReturnSuggestions, equals(voidReturn));
+ expect(visitor.includeStatementLabelSuggestions, equals(statementLabel));
}
test_Annotation() {
@@ -193,6 +194,21 @@ class OpTypeTest {
assertOpType(returnValue: true, typeNames: true, voidReturn: true);
}
+ test_Break_after_label() {
+ addTestSource('main() { foo: while (true) { break foo ^ ; } }');
+ assertOpType(/* No valid completions */);
+ }
+
+ test_Break_before_label() {
+ addTestSource('main() { foo: while (true) { break ^ foo; } }');
+ assertOpType(statementLabel: true);
+ }
+
+ test_Break_no_label() {
+ addTestSource('main() { foo: while (true) { break ^; } }');
+ assertOpType(statementLabel: true);
+ }
+
test_CascadeExpression_selector1() {
// PropertyAccess CascadeExpression ExpressionStatement Block
addTestSource('''
@@ -307,6 +323,21 @@ class OpTypeTest {
assertOpType(invocation: true);
}
+ test_Continue_after_label() {
+ addTestSource('main() { foo: while (true) { continue foo ^ ; } }');
+ assertOpType(/* No valid completions */);
+ }
+
+ test_Continue_before_label() {
+ addTestSource('main() { foo: while (true) { continue ^ foo; } }');
+ assertOpType(statementLabel: true);
+ }
+
+ test_Continue_no_label() {
+ addTestSource('main() { foo: while (true) { continue ^; } }');
+ assertOpType(statementLabel: true);
+ }
+
test_DoStatement() {
// SimpleIdentifier DoStatement Block
addTestSource('main() {do{} while(^x);}');
« no previous file with comments | « pkg/analysis_server/test/services/completion/local_computer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698