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

Unified Diff: pkg/analysis_server/test/domain_completion_test.dart

Issue 1834423002: Sort the files in analysis_server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/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 61734b6ddac1d076770436e611d2568a7a372897..3435be7040f0698a1a226a3a555d767ae5a45edc 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -211,47 +211,6 @@ class CompletionDomainHandlerTest extends AbstractCompletionDomainTest {
});
}
- test_invocation() {
- addTestFile('class A {b() {}} main() {A a; a.^}');
- return getSuggestions().then((_) {
- expect(replacementOffset, equals(completionOffset));
- expect(replacementLength, equals(0));
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'b');
- });
- }
-
- test_invocation_sdk_relevancy_off() {
- var originalSorter = DartCompletionManager.contributionSorter;
- var mockSorter = new MockRelevancySorter();
- DartCompletionManager.contributionSorter = mockSorter;
- addTestFile('main() {Map m; m.^}');
- return getSuggestions().then((_) {
- // Assert that the CommonUsageComputer has been replaced
- expect(suggestions.any((s) => s.relevance == DART_RELEVANCE_COMMON_USAGE),
- isFalse);
- DartCompletionManager.contributionSorter = originalSorter;
- mockSorter.enabled = false;
- });
- }
-
- test_invocation_sdk_relevancy_on() {
- addTestFile('main() {Map m; m.^}');
- return getSuggestions().then((_) {
- // Assert that the CommonUsageComputer is working
- expect(suggestions.any((s) => s.relevance == DART_RELEVANCE_COMMON_USAGE),
- isTrue);
- });
- }
-
- test_invocation_withTrailingStmt() {
- addTestFile('class A {b() {}} main() {A a; a.^ int x = 7;}');
- return getSuggestions().then((_) {
- expect(replacementOffset, equals(completionOffset));
- expect(replacementLength, equals(0));
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'b');
- });
- }
-
test_inComment_block_beforeNode() async {
addTestFile('''
main(aaa, bbb) {
@@ -348,6 +307,47 @@ class B extends A {
});
}
+ test_invocation() {
+ addTestFile('class A {b() {}} main() {A a; a.^}');
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(completionOffset));
+ expect(replacementLength, equals(0));
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'b');
+ });
+ }
+
+ test_invocation_sdk_relevancy_off() {
+ var originalSorter = DartCompletionManager.contributionSorter;
+ var mockSorter = new MockRelevancySorter();
+ DartCompletionManager.contributionSorter = mockSorter;
+ addTestFile('main() {Map m; m.^}');
+ return getSuggestions().then((_) {
+ // Assert that the CommonUsageComputer has been replaced
+ expect(suggestions.any((s) => s.relevance == DART_RELEVANCE_COMMON_USAGE),
+ isFalse);
+ DartCompletionManager.contributionSorter = originalSorter;
+ mockSorter.enabled = false;
+ });
+ }
+
+ test_invocation_sdk_relevancy_on() {
+ addTestFile('main() {Map m; m.^}');
+ return getSuggestions().then((_) {
+ // Assert that the CommonUsageComputer is working
+ expect(suggestions.any((s) => s.relevance == DART_RELEVANCE_COMMON_USAGE),
+ isTrue);
+ });
+ }
+
+ test_invocation_withTrailingStmt() {
+ addTestFile('class A {b() {}} main() {A a; a.^ int x = 7;}');
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(completionOffset));
+ expect(replacementLength, equals(0));
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'b');
+ });
+ }
+
test_keyword() {
addTestFile('library A; cl^');
return getSuggestions().then((_) {

Powered by Google App Engine
This is Rietveld 408576698