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

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

Issue 2394683006: Switch analysis_server to use 'package:test'. (Closed)
Patch Set: Created 4 years, 2 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/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(

Powered by Google App Engine
This is Rietveld 408576698