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

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

Issue 915023002: check for null completion node (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 10 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/dart_completion_manager.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/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 08fa7e6dfe90a88eca031a45888cbd709c45b504..21307d553142c03936547e54218b3fbc7fff7d4f 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -364,46 +364,6 @@ class CompletionTest extends AbstractAnalysisTest {
});
}
- test_partFile() {
- addFile('/project/bin/testA.dart', '''
- library libA;
- part "$testFile";
- import 'dart:html';
- class A { }
- ''');
- addTestFile('''
- part of libA;
- main() {^}''');
- return getSuggestions().then((_) {
- expect(replacementOffset, equals(completionOffset));
- expect(replacementLength, equals(0));
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'HtmlElement');
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'A');
- assertNoResult('test');
- });
- }
-
- test_partFile2() {
- addFile('/testA.dart', '''
- part of libA;
- class A { }''');
- addTestFile('''
- library libA;
- part "/testA.dart";
- import 'dart:html';
- main() {^}
- ''');
- return getSuggestions().then((_) {
- expect(replacementOffset, equals(completionOffset));
- expect(replacementLength, equals(0));
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'HtmlElement');
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'A');
- assertNoResult('test');
- });
- }
-
test_imports_prefixed() {
addTestFile('''
import 'dart:html' as foo;
@@ -484,6 +444,61 @@ class CompletionTest extends AbstractAnalysisTest {
});
}
+ test_partFile() {
+ addFile('/project/bin/testA.dart', '''
+ library libA;
+ part "$testFile";
+ import 'dart:html';
+ class A { }
+ ''');
+ addTestFile('''
+ part of libA;
+ main() {^}''');
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(completionOffset));
+ expect(replacementLength, equals(0));
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'HtmlElement');
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'A');
+ assertNoResult('test');
+ });
+ }
+
+ test_partFile2() {
+ addFile('/testA.dart', '''
+ part of libA;
+ class A { }''');
+ addTestFile('''
+ library libA;
+ part "/testA.dart";
+ import 'dart:html';
+ main() {^}
+ ''');
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(completionOffset));
+ expect(replacementLength, equals(0));
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'HtmlElement');
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'A');
+ assertNoResult('test');
+ });
+ }
+
+ test_simple() {
+ addTestFile('''
+ void main() {
+ ^
+ }
+ ''');
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(completionOffset));
+ expect(replacementLength, equals(0));
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
+ assertNoResult('HtmlElement');
+ assertNoResult('test');
+ });
+ }
+
test_topLevel() {
addTestFile('''
typedef foo();
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698