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

Side by Side Diff: pkg/analysis_services/test/completion/top_level_computer_test.dart

Issue 458073002: rename and improve imported completion computer (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_services/test/completion/test_all.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library test.services.completion.toplevel;
6
7 import 'package:analysis_services/completion/completion_suggestion.dart';
8 import 'package:analysis_services/src/completion/top_level_computer.dart';
9 import 'package:analysis_testing/reflective_tests.dart';
10 import 'package:unittest/unittest.dart';
11
12 import 'completion_test_util.dart';
13
14 main() {
15 groupSep = ' | ';
16 runReflectiveTests(TopLevelComputerTest);
17 }
18
19 @ReflectiveTestCase()
20 class TopLevelComputerTest extends AbstractCompletionTest {
21
22 @override
23 void setUp() {
24 super.setUp();
25 computer = new TopLevelComputer();
26 }
27
28 test_class() {
29 addSource('/testA.dart', 'class A {int x;} class _B { }');
30 addTestSource('import "/testA.dart"; class C {foo(){^}}');
31 return computeFull().then((_) {
32 assertSuggestClass('A');
33 assertNotSuggested('x');
34 assertNotSuggested('_B');
35 });
36 }
37
38 test_class_notImported() {
39 addSource('/testA.dart', 'class A {int x;} class _B { }');
40 addTestSource('class C {foo(){^}}');
41 return computeFull().then((_) {
42 assertSuggestClass('A', CompletionRelevance.LOW);
43 assertNotSuggested('x');
44 assertNotSuggested('_B');
45 });
46 }
47
48 test_dartCore() {
49 addTestSource('class C {foo(){^}}');
50 return computeFull().then((_) {
51 assertSuggestClass('Object');
52 assertNotSuggested('HtmlElement');
53 });
54 }
55
56 test_dartHtml() {
57 addTestSource('import "dart:html"; class C {foo(){^}}');
58 return computeFull().then((_) {
59 assertSuggestClass('Object');
60 assertSuggestClass('HtmlElement');
61 });
62 }
63
64 test_topLevelVar() {
65 addSource('/testA.dart', 'var T1; var _T2;');
66 addTestSource('import "/testA.dart"; class C {foo(){^}}');
67 return computeFull().then((_) {
68 assertSuggestTopLevelVar('T1');
69 assertNotSuggested('_T2');
70 });
71 }
72
73 test_topLevelVar_notImported() {
74 addSource('/testA.dart', 'var T1; var _T2;');
75 addTestSource('class C {foo(){^}}');
76 return computeFull().then((_) {
77 assertSuggestTopLevelVar('T1', CompletionRelevance.LOW);
78 assertNotSuggested('_T2');
79 });
80 }
81 }
OLDNEW
« no previous file with comments | « pkg/analysis_services/test/completion/test_all.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698