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

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

Issue 972933002: add arguments to constructor completions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix tests 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
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 5290ba462f44e06970edd795ec36733acbdd0289..e5f0fbcc88acecd75ff4f7a7b6aebbc5cc7a5671 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -44,7 +44,7 @@ class OpTypeTest {
void assertOpType({bool invocation: false, bool returnValue: false,
bool typeNames: false, bool voidReturn: false, bool statementLabel: false,
- bool caseLabel: false}) {
+ bool caseLabel: false, bool constructors: false}) {
expect(visitor.includeInvocationSuggestions, equals(invocation),
reason: 'invocation');
expect(visitor.includeReturnValueSuggestions, equals(returnValue),
@@ -57,6 +57,8 @@ class OpTypeTest {
reason: 'statementLabel');
expect(visitor.includeCaseLabelSuggestions, equals(caseLabel),
reason: 'caseLabel');
+ expect(visitor.includeConstructorSuggestions, equals(constructors),
+ reason: 'constructors');
}
test_Annotation() {
@@ -331,7 +333,7 @@ class OpTypeTest {
// SimpleIdentifier PrefixedIdentifier TypeName ConstructorName
// InstanceCreationExpression
addTestSource('main() {new Str^ing.fromCharCodes([]);}', resolved: true);
- assertOpType(typeNames: true);
+ assertOpType(constructors: true);
}
test_ConstructorName_resolved() {
@@ -554,10 +556,16 @@ class OpTypeTest {
assertOpType(returnValue: true, typeNames: true);
}
- test_InstanceCreationExpression_imported() {
+ test_InstanceCreationExpression() {
// SimpleIdentifier TypeName ConstructorName InstanceCreationExpression
addTestSource('class C {foo(){var f; {var x;} new ^}}');
- assertOpType(typeNames: true);
+ assertOpType(constructors: true);
+ }
+
+ test_InstanceCreationExpression_trailingStmt() {
+ // SimpleIdentifier TypeName ConstructorName InstanceCreationExpression
+ addTestSource('class C {foo(){var f; {var x;} new ^ int x = 7;}}');
+ assertOpType(constructors: true);
}
test_InstanceCreationExpression_keyword() {

Powered by Google App Engine
This is Rietveld 408576698