Chromium Code Reviews| 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); |
| - } |
| } |