File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import 'package:dartdoc/src/render/model_element_renderer.dart';
1515import 'package:dartdoc/src/render/parameter_renderer.dart' ;
1616import 'package:dartdoc/src/render/typedef_renderer.dart' ;
1717import 'package:dartdoc/src/special_elements.dart' ;
18+ import 'package:dartdoc/src/tuple.dart' ;
1819import 'package:dartdoc/src/warnings.dart' ;
1920import 'package:test/test.dart' ;
2021
@@ -882,6 +883,24 @@ void main() {
882883 docsAsHtml = doAwesomeStuff.documentationAsHtml;
883884 });
884885
886+ test ('Verify links to inherited members inside class' , () {
887+ expect (
888+ docsAsHtml,
889+ contains (
890+ '<a href="${HTMLBASE_PLACEHOLDER }fake/ImplicitProperties/forInheriting.html">ClassWithUnusualProperties.forInheriting</a>' ));
891+ expect (
892+ docsAsHtml,
893+ contains (
894+ '<a href="%%__HTMLBASE_dartdoc_internal__%%reexport_two/BaseReexported/action.html">ExtendedBaseReexported.action</a></p>' ));
895+ var doAwesomeStuffWarnings = packageGraph.packageWarningCounter
896+ .countedWarnings[doAwesomeStuff.element] ??
897+ [];
898+ expect (
899+ doAwesomeStuffWarnings,
900+ isNot (anyElement ((Tuple2 <PackageWarning , String > e) =>
901+ e.item1 == PackageWarning .ambiguousDocReference)));
902+ });
903+
885904 test ('can handle renamed imports' , () {
886905 var aFunctionUsingRenamedLib = fakeLibrary.functions
887906 .firstWhere ((f) => f.name == 'aFunctionUsingRenamedLib' );
Original file line number Diff line number Diff line change @@ -858,6 +858,7 @@ class ExtraSpecialList<E> extends SpecialList {}
858858/// {@subCategory Things and Such}
859859/// {@image https://flutter.io/images/catalog-widget-placeholder.png}
860860/// {@samples https://flutter.io}
861+ ///
861862class BaseForDocComments {
862863 /// Takes a [value] and returns a String.
863864 ///
@@ -899,6 +900,10 @@ class BaseForDocComments {
899900 ///
900901 /// Reference to something that doesn't exist containing a type parameter [ThisIsNotHereNoWay<MyType>]
901902 ///
903+ /// Reference to an inherited member: [ClassWithUnusualProperties.forInheriting]
904+ ///
905+ /// Reference to an inherited member in another library via class name: [ExtendedBaseReexported.action]
906+ ///
902907 /// Link to a nonexistent file (erroneously expects base href): [link] (SubForDocComments/localMethod.html)
903908 ///
904909 /// Link to an existing file: [link] (../SubForDocComments/localMethod.html)
Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ class YetAnotherClass {}
88
99class AUnicornClass {}
1010
11+ class BaseReexported {
12+ String action;
13+ }
14+
15+ class ExtendedBaseReexported extends BaseReexported {
16+ }
17+
1118/// A private extension.
1219extension _Unseen on Object {
1320 void doYouSeeMe () { }
@@ -21,4 +28,4 @@ extension on List {
2128/// [_Unseen] is not seen, but [DocumentMe] is.
2229extension DocumentThisExtensionOnce on String {
2330 String get reportOnString => '$this is wonderful' ;
24- }
31+ }
You can’t perform that action at this time.
0 commit comments