Index: pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart |
diff --git a/pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart |
index 0d1b13d0df3f730e4e458becee4a8be67bb2226e..26df23e66627ce066eb7d58e5f095aa4cc230d98 100644 |
--- a/pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart |
+++ b/pkg/analysis_server/test/services/completion/dart/local_constructor_contributor_test.dart |
@@ -11,15 +11,17 @@ import 'package:analysis_server/plugin/protocol/protocol.dart' |
import 'package:analysis_server/src/protocol_server.dart'; |
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart'; |
import 'package:analysis_server/src/services/completion/dart/local_constructor_contributor.dart'; |
+import 'package:test/test.dart'; |
import 'package:test_reflective_loader/test_reflective_loader.dart'; |
-import 'package:unittest/unittest.dart'; |
import '../../../utils.dart'; |
import 'completion_contributor_util.dart'; |
main() { |
initializeTestEnvironment(); |
- defineReflectiveTests(LocalConstructorContributorTest); |
+ defineReflectiveSuite(() { |
+ defineReflectiveTests(LocalConstructorContributorTest); |
+ }); |
} |
@reflectiveTest |
@@ -2404,6 +2406,44 @@ main() {new ^ String x = "hello";}'''); |
expect(suggestion.hasNamedParameters, true); |
} |
+ test_InstanceCreationExpression_assignment_expression_filter() async { |
+ addTestSource(''' |
+class A {} class B extends A {} class C implements A {} class D {} |
+main() { |
+ A a; |
+ a = new ^ |
+}'''); |
+ await computeSuggestions(); |
+ |
+ assertSuggestConstructor('A', |
+ elemOffset: -1, |
+ relevance: DART_RELEVANCE_DEFAULT + DART_RELEVANCE_INCREMENT); |
+ assertSuggestConstructor('B', |
+ elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT); |
+ assertSuggestConstructor('C', |
+ elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT); |
+ assertNotSuggested('D'); |
+ } |
+ |
+ test_InstanceCreationExpression_assignment_expression_filter2() async { |
+ addTestSource(''' |
+class A {} class B extends A {} class C implements A {} class D {} |
+main() { |
+ A a; |
+ a = new ^; |
+}'''); |
+ await computeSuggestions(); |
+ |
+ assertSuggestConstructor('A', |
+ elemOffset: -1, |
+ relevance: DART_RELEVANCE_DEFAULT + DART_RELEVANCE_INCREMENT); |
+ assertSuggestConstructor('B', |
+ elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT); |
+ assertSuggestConstructor('C', |
+ elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT); |
+ assertNotSuggested('D'); |
+ } |
+ |
test_InstanceCreationExpression_imported() async { |
// SimpleIdentifier TypeName ConstructorName InstanceCreationExpression |
addSource( |
@@ -2485,44 +2525,6 @@ main() { |
assertNotSuggested('D'); |
} |
- test_InstanceCreationExpression_assignment_expression_filter() async { |
- addTestSource(''' |
-class A {} class B extends A {} class C implements A {} class D {} |
-main() { |
- A a; |
- a = new ^ |
-}'''); |
- await computeSuggestions(); |
- |
- assertSuggestConstructor('A', |
- elemOffset: -1, |
- relevance: DART_RELEVANCE_DEFAULT + DART_RELEVANCE_INCREMENT); |
- assertSuggestConstructor('B', |
- elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT); |
- assertSuggestConstructor('C', |
- elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT); |
- assertNotSuggested('D'); |
- } |
- |
- test_InstanceCreationExpression_assignment_expression_filter2() async { |
- addTestSource(''' |
-class A {} class B extends A {} class C implements A {} class D {} |
-main() { |
- A a; |
- a = new ^; |
-}'''); |
- await computeSuggestions(); |
- |
- assertSuggestConstructor('A', |
- elemOffset: -1, |
- relevance: DART_RELEVANCE_DEFAULT + DART_RELEVANCE_INCREMENT); |
- assertSuggestConstructor('B', |
- elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT); |
- assertSuggestConstructor('C', |
- elemOffset: -1, relevance: DART_RELEVANCE_DEFAULT); |
- assertNotSuggested('D'); |
- } |
- |
test_InterpolationExpression() async { |
// SimpleIdentifier InterpolationExpression StringInterpolation |
addSource( |