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

Unified 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: New test cases and tweaks. Created 4 years, 11 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_server/test/analysis/get_hover_test.dart
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index cc1a4e47786f88267bad2c148274c7eea77a98b8..672e9f2052f8a72d259829fe2fd66b54cddc673a 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -96,6 +96,71 @@ main() {
expect(hover.dartdoc, '''doc aaa\ndoc bbb''');
}
+ test_dartdoc_inherited_methodByMethod_fromInterface() async {
+ addTestFile('''
+class A {
+ /// my doc
+ m() {} // in A
+}
+
+class B implements A {
+ m() {} // in B
+}
+''');
+ HoverInformation hover = await prepareHover('m() {} // in B');
+ expect(hover.dartdoc, '''my doc\n\nCopied from `A`.''');
+ }
+
+ test_dartdoc_inherited_methodByMethod_fromSuper_direct() async {
+ addTestFile('''
+class A {
+ /// my doc
+ m() {} // in A
+}
+
+class B extends A {
+ m() {} // in B
+}
+''');
+ HoverInformation hover = await prepareHover('m() {} // in B');
+ expect(hover.dartdoc, '''my doc\n\nCopied from `A`.''');
+ }
+
+ test_dartdoc_inherited_methodByMethod_fromSuper_indirect() async {
+ addTestFile('''
+class A {
+ /// my doc
+ m() {}
+}
+class B extends A {
+ m() {}
+}
+class C extends B {
+ m() {} // in C
+}''');
+ HoverInformation hover = await prepareHover('m() {} // in C');
+ expect(hover.dartdoc, '''my doc\n\nCopied from `A`.''');
+ }
+
+ test_dartdoc_inherited_methodByMethod_preferSuper() async {
+ addTestFile('''
+class A {
+ /// my doc
+ m() {}
+}
+class B extends A {
+}
+class I {
+ // wrong doc
+ m() {}
+}
+class C extends B implements I {
+ m() {} // in C
+}''');
+ HoverInformation hover = await prepareHover('m() {} // in C');
+ expect(hover.dartdoc, '''my doc\n\nCopied from `A`.''');
+ }
+
test_enum() async {
addTestFile('''
enum MyEnum {AAA, BBB, CCC}

Powered by Google App Engine
This is Rietveld 408576698