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

Side by Side Diff: pkg/analysis_server/test/analysis/get_hover_test.dart

Issue 1632033002: Issue 25542. If an element does not have its own documentation, use the documentation from the over… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_overrides.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
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.domain.analysis.hover; 5 library test.domain.analysis.hover;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; 9 import 'package:analysis_server/plugin/protocol/protocol.dart';
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; 10 import 'package:test_reflective_loader/test_reflective_loader.dart';
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 library my.library; 89 library my.library;
90 /// doc aaa 90 /// doc aaa
91 /// doc bbb 91 /// doc bbb
92 main() { 92 main() {
93 } 93 }
94 '''); 94 ''');
95 HoverInformation hover = await prepareHover('main() {'); 95 HoverInformation hover = await prepareHover('main() {');
96 expect(hover.dartdoc, '''doc aaa\ndoc bbb'''); 96 expect(hover.dartdoc, '''doc aaa\ndoc bbb''');
97 } 97 }
98 98
99 test_dartdoc_inherited_methodByMethod_fromInterface() async {
Brian Wilkerson 2016/01/25 22:09:59 I'll suggest a couple more tests. (1) Indirectly
scheglov 2016/01/26 00:52:50 Done.
scheglov 2016/01/26 00:52:50 Done.
100 addTestFile('''
101 class A {
102 /// my doc
103 m() {} // in A
104 }
105
106 class B implements A {
107 m() {} // in B
108 }
109 ''');
110 HoverInformation hover = await prepareHover('m() {} // in B');
111 expect(hover.dartdoc, '''my doc\n\nCopied from `A`.''');
112 }
113
114 test_dartdoc_inherited_methodByMethod_fromSuper() async {
115 addTestFile('''
116 class A {
117 /// my doc
118 m() {} // in A
119 }
120
121 class B extends A {
122 m() {} // in B
123 }
124 ''');
125 HoverInformation hover = await prepareHover('m() {} // in B');
126 expect(hover.dartdoc, '''my doc\n\nCopied from `A`.''');
127 }
128
99 test_enum() async { 129 test_enum() async {
100 addTestFile(''' 130 addTestFile('''
101 enum MyEnum {AAA, BBB, CCC} 131 enum MyEnum {AAA, BBB, CCC}
102 '''); 132 ''');
103 HoverInformation hover = await prepareHover('MyEnum'); 133 HoverInformation hover = await prepareHover('MyEnum');
104 expect(hover.elementDescription, 'enum MyEnum'); 134 expect(hover.elementDescription, 'enum MyEnum');
105 expect(hover.staticType, isNull); 135 expect(hover.staticType, isNull);
106 expect(hover.propagatedType, isNull); 136 expect(hover.propagatedType, isNull);
107 } 137 }
108 138
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 addTestFile(''' 424 addTestFile('''
395 library my.library; 425 library my.library;
396 main() { 426 main() {
397 // nothing 427 // nothing
398 } 428 }
399 '''); 429 ''');
400 HoverInformation hover = await prepareHover('nothing'); 430 HoverInformation hover = await prepareHover('nothing');
401 expect(hover, isNull); 431 expect(hover, isNull);
402 } 432 }
403 } 433 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_overrides.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698