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

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

Issue 1067143002: suggest deferred/as keywords (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
index 9e4a41157ca2d92f271a10c63d81510d72057881..547f1c90dfbeb53ea1dd5a7692bb7d00fa7b3a58 100644
--- a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
@@ -176,14 +176,14 @@ class KeywordContributorTest extends AbstractCompletionTest {
}
test_after_import() {
- addTestSource('import foo; ^');
+ addTestSource('import "foo"; ^');
expect(computeFast(), isTrue);
assertSuggestKeywords(
DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_after_import2() {
- addTestSource('import foo; c^');
+ addTestSource('import "foo"; c^');
expect(computeFast(), isTrue);
assertSuggestKeywords(
DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
@@ -404,6 +404,66 @@ class A {
assertSuggestKeywords(IN_BLOCK_NOT_IN_CLASS);
}
+ test_import() {
+ addTestSource('import "foo" deferred as foo ^;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_as() {
+ addTestSource('import "foo" deferred ^;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.AS], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_as2() {
+ addTestSource('import "foo" deferred a^;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.AS], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_as3() {
+ addTestSource('import "foo" deferred a^');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.AS], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_deferred() {
+ addTestSource('import "foo" ^ as foo;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_deferred_not() {
+ addTestSource('import "foo" as foo ^;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_deferred_as() {
+ addTestSource('import "foo" ^;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_deferred_as2() {
+ addTestSource('import "foo" d^;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_deferred_as3() {
+ addTestSource('import "foo" ^');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ }
+
+ test_import_deferred_as4() {
+ addTestSource('import "foo" d^');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED], DART_RELEVANCE_HIGH);
+ }
+
test_library() {
addTestSource('library foo;^');
expect(computeFast(), isTrue);
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698