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

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

Issue 902913002: fix completions in indexed expression (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/completion_test_util.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 9e6d8e0b250243a64989c843cdaec37f1db31a55..5b009584c75a0ac80db76decba481e14305e0ee0 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -46,12 +46,30 @@ class OpTypeTest {
void assertOpType({bool invocation: false, bool returnValue: false,
bool typeNames: false, bool voidReturn: false, bool statementLabel: false,
bool caseLabel: 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));
- expect(visitor.includeCaseLabelSuggestions, equals(caseLabel));
+ expect(
+ visitor.includeInvocationSuggestions,
+ equals(invocation),
+ reason: 'invocation');
+ expect(
+ visitor.includeReturnValueSuggestions,
+ equals(returnValue),
+ reason: 'returnValue');
+ expect(
+ visitor.includeTypeNameSuggestions,
+ equals(typeNames),
+ reason: 'typeNames');
+ expect(
+ visitor.includeVoidReturnSuggestions,
+ equals(voidReturn),
+ reason: 'voidReturn');
+ expect(
+ visitor.includeStatementLabelSuggestions,
+ equals(statementLabel),
+ reason: 'statementLabel');
+ expect(
+ visitor.includeCaseLabelSuggestions,
+ equals(caseLabel),
+ reason: 'caseLabel');
}
test_Annotation() {
@@ -467,6 +485,16 @@ class OpTypeTest {
assertOpType();
}
+ test_IndexExpression() {
+ addTestSource('class C {foo(){var f; {var x;} f[^]}}');
+ assertOpType(returnValue: true, typeNames: true);
+ }
+
+ test_IndexExpression2() {
+ addTestSource('class C {foo(){var f; {var x;} f[T^]}}');
+ assertOpType(returnValue: true, typeNames: true);
+ }
+
test_InstanceCreationExpression_imported() {
// SimpleIdentifier TypeName ConstructorName InstanceCreationExpression
addTestSource('class C {foo(){var f; {var x;} new ^}}');
@@ -476,19 +504,13 @@ class OpTypeTest {
test_InstanceCreationExpression_keyword() {
// InstanceCreationExpression ExpressionStatement Block
addTestSource('class C {foo(){var f; {var x;} new^ }}');
- assertOpType(
- returnValue: true,
- typeNames: true,
- voidReturn: true);
+ assertOpType(returnValue: true, typeNames: true, voidReturn: true);
}
test_InstanceCreationExpression_keyword2() {
// InstanceCreationExpression ExpressionStatement Block
addTestSource('class C {foo(){var f; {var x;} new^ C();}}');
- assertOpType(
- returnValue: true,
- typeNames: true,
- voidReturn: true);
+ assertOpType(returnValue: true, typeNames: true, voidReturn: true);
}
test_InterpolationExpression() {
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698