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

Unified Diff: pkg/analysis_services/test/completion/top_level_computer_test.dart

Issue 440343003: incremental improvement to top level code completion results (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 4 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_services/test/completion/top_level_computer_test.dart
diff --git a/pkg/analysis_services/test/completion/top_level_computer_test.dart b/pkg/analysis_services/test/completion/top_level_computer_test.dart
index b12e07e397ac3b38e6f9fce18fc295a77a91ebdd..4136c94442e4b4801449c6036dc493cfb113cd78 100644
--- a/pkg/analysis_services/test/completion/top_level_computer_test.dart
+++ b/pkg/analysis_services/test/completion/top_level_computer_test.dart
@@ -19,17 +19,24 @@ main() {
@ReflectiveTestCase()
class TopLevelComputerTest extends AbstractCompletionTest {
- test_class() {
- addTestUnit('class B {boolean v;}');
+ void addTestUnit(String content) {
+ super.addTestUnit(content);
+ computer = new TopLevelComputer(searchEngine, testUnit);
+ }
+
+ test_class_1() {
+ addUnit('/testA.dart', 'var T1; class A {bool x;}');
+ addUnit('/testB.dart', 'class B {bool y;}');
+ addTestUnit('import "/testA.dart"; class C {bool v;^}');
return compute().then((_) {
- assertHasResult(CompletionSuggestionKind.CLASS, 'B');
+ assertHasResult(CompletionSuggestionKind.CLASS, 'A');
+ assertHasResult(CompletionSuggestionKind.CLASS, 'B', CompletionRelevance.LOW);
+ assertHasResult(CompletionSuggestionKind.CLASS, 'C');
+ assertHasResult(CompletionSuggestionKind.CLASS, 'Object');
+ assertHasResult(CompletionSuggestionKind.TOP_LEVEL_VARIABLE, 'T1');
scheglov 2014/08/07 02:42:26 Is a top-level variable suggestion useful here? I
danrubel 2014/08/08 20:28:39 Top level variables in one library can be accessed
scheglov 2014/08/08 20:58:43 Correct me if I'm wrong, but I don't think we can
danrubel 2014/08/09 10:23:03 Ah, now I understand what you are saying. Yes, thi
+ assertNoResult('x');
+ assertNoResult('y');
assertNoResult('v');
});
}
-
- @override
- void setUp() {
- super.setUp();
- computer = new TopLevelComputer(searchEngine);
- }
}

Powered by Google App Engine
This is Rietveld 408576698