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

Side by Side Diff: pkg/analysis_server/test/services/completion/arglist_computer_test.dart

Issue 1068483002: rename completion source files to match content (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
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.dart.arglist;
6
7 import 'package:analysis_server/src/protocol.dart';
8 import 'package:analysis_server/src/services/completion/arglist_computer.dart';
9 import 'package:unittest/unittest.dart';
10
11 import '../../reflective_tests.dart';
12 import 'completion_test_util.dart';
13
14 main() {
15 groupSep = ' | ';
16 runReflectiveTests(ArgListContributorTest);
17 }
18
19 @reflectiveTest
20 class ArgListContributorTest extends AbstractCompletionTest {
21 @override
22 void setUpContributor() {
23 contributor = new ArgListContributor();
24 }
25
26 test_ArgumentList_imported_function_0() {
27 // ArgumentList MethodInvocation ExpressionStatement Block
28 addSource('/libA.dart', '''
29 library A;
30 bool hasLength(int expected) { }
31 expect() { }
32 void baz() { }''');
33 addTestSource('''
34 import '/libA.dart'
35 class B { }
36 String bar() => true;
37 void main() {expect(^)}''');
38 computeFast();
39 return computeFull((bool result) {
40 assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
41 });
42 }
43
44 // test_ArgumentList_imported_function_1() {
45 // // ArgumentList MethodInvocation ExpressionStatement Block
46 // addSource('/libA.dart', '''
47 // library A;
48 // bool hasLength(int expected) { }
49 // expect(String arg) { }
50 // void baz() { }''');
51 // addTestSource('''
52 // import '/libA.dart'
53 // class B { }
54 // String bar() => true;
55 // void main() {expect(^)}''');
56 // computeFast();
57 // return computeFull((bool result) {
58 // assertSuggestArgumentList(['arg'], ['String']);
59 // });
60 // }
61
62 test_ArgumentList_local_function_1() {
63 // ArgumentList MethodInvocation ExpressionStatement Block
64 addSource('/libA.dart', '''
65 library A;
66 bool hasLength(int expected) { }
67 void baz() { }''');
68 addTestSource('''
69 import '/libA.dart'
70 expect(arg) { }
71 class B { }
72 String bar() => true;
73 void main() {expect(^)}''');
74 computeFast();
75 return computeFull((bool result) {
76 assertSuggestArgumentList(['arg'], ['dynamic']);
77 });
78 }
79
80 test_ArgumentList_local_method_0() {
81 // ArgumentList MethodInvocation ExpressionStatement Block
82 addSource('/libA.dart', '''
83 library A;
84 bool hasLength(int expected) { }
85 void baz() { }''');
86 addTestSource('''
87 import '/libA.dart'
88 class B {
89 expect() { }
90 void foo() {expect(^)}}
91 String bar() => true;''');
92 computeFast();
93 return computeFull((bool result) {
94 assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
95 });
96 }
97
98 test_ArgumentList_local_method_2() {
99 // ArgumentList MethodInvocation ExpressionStatement Block
100 addSource('/libA.dart', '''
101 library A;
102 bool hasLength(int expected) { }
103 void baz() { }''');
104 addTestSource('''
105 import '/libA.dart'
106 class B {
107 expect(arg, int blat) { }
108 void foo() {expect(^)}}
109 String bar() => true;''');
110 computeFast();
111 return computeFull((bool result) {
112 assertSuggestArgumentList(['arg', 'blat'], ['dynamic', 'int']);
113 });
114 }
115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698