Index: pkg/analysis_server/test/domain_completion_test.dart |
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart |
index 81d8a353ac3b79acc58eda76eefa37231b298c33..91cf4a0034098245eb196ac591f62ec034d1a4b1 100644 |
--- a/pkg/analysis_server/test/domain_completion_test.dart |
+++ b/pkg/analysis_server/test/domain_completion_test.dart |
@@ -12,8 +12,8 @@ import 'package:analysis_server/src/provisional/completion/completion_core.dart' |
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart'; |
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart'; |
import 'package:analysis_server/src/services/completion/dart/contribution_sorter.dart'; |
+import 'package:test/test.dart'; |
import 'package:test_reflective_loader/test_reflective_loader.dart'; |
-import 'package:unittest/unittest.dart'; |
import 'analysis_abstract.dart'; |
import 'domain_completion_util.dart'; |
@@ -22,8 +22,10 @@ import 'utils.dart'; |
main() { |
initializeTestEnvironment(); |
- defineReflectiveTests(CompletionDomainHandlerTest); |
- defineReflectiveTests(_NoSearchEngine); |
+ defineReflectiveSuite(() { |
+ defineReflectiveTests(CompletionDomainHandlerTest); |
+ defineReflectiveTests(_NoSearchEngine); |
+ }); |
} |
@reflectiveTest |
@@ -48,6 +50,15 @@ class CompletionDomainHandlerTest extends AbstractCompletionDomainTest { |
expect(suggestions, hasLength(2)); |
} |
+ test_ArgumentList_imported_function_named_param2() async { |
+ addTestFile('mainx() {A a = new A(); a.foo(one: 7, ^);}' |
+ 'class A { foo({one, two}) {} }'); |
+ await getSuggestions(); |
+ assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ', |
+ relevance: DART_RELEVANCE_NAMED_PARAMETER); |
+ expect(suggestions, hasLength(1)); |
+ } |
+ |
test_ArgumentList_imported_function_named_param_label1() async { |
addTestFile('main() { int.parse("16", r^: 16);}'); |
await getSuggestions(); |
@@ -68,15 +79,6 @@ class CompletionDomainHandlerTest extends AbstractCompletionDomainTest { |
expect(suggestions, hasLength(2)); |
} |
- test_ArgumentList_imported_function_named_param2() async { |
- addTestFile('mainx() {A a = new A(); a.foo(one: 7, ^);}' |
- 'class A { foo({one, two}) {} }'); |
- await getSuggestions(); |
- assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ', |
- relevance: DART_RELEVANCE_NAMED_PARAMETER); |
- expect(suggestions, hasLength(1)); |
- } |
- |
test_html() { |
testFile = '/project/web/test.html'; |
addTestFile(''' |
@@ -89,6 +91,20 @@ class CompletionDomainHandlerTest extends AbstractCompletionDomainTest { |
}); |
} |
+ test_import_uri_with_trailing() { |
+ addFile('/project/bin/testA.dart', 'library libA;'); |
+ addTestFile(''' |
+ import '/project/bin/t^.dart'; |
+ main() {}'''); |
+ return getSuggestions().then((_) { |
+ expect(replacementOffset, equals(completionOffset - 14)); |
+ expect(replacementLength, equals(5 + 14)); |
+ assertHasResult( |
+ CompletionSuggestionKind.IMPORT, '/project/bin/testA.dart'); |
+ assertNoResult('test'); |
+ }); |
+ } |
+ |
test_imports() { |
addTestFile(''' |
import 'dart:html'; |
@@ -561,20 +577,6 @@ class B extends A {m() {^}} |
assertNoResult('HtmlElement'); |
}); |
} |
- |
- test_import_uri_with_trailing() { |
- addFile('/project/bin/testA.dart', 'library libA;'); |
- addTestFile(''' |
- import '/project/bin/t^.dart'; |
- main() {}'''); |
- return getSuggestions().then((_) { |
- expect(replacementOffset, equals(completionOffset - 14)); |
- expect(replacementLength, equals(5 + 14)); |
- assertHasResult( |
- CompletionSuggestionKind.IMPORT, '/project/bin/testA.dart'); |
- assertNoResult('test'); |
- }); |
- } |
} |
class MockRelevancySorter implements DartContributionSorter { |