File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1182,6 +1182,21 @@ void main() {
11821182 expect (docsAsHtml,
11831183 contains ('<code>ThisIsNotHereNoWay<MyType></code>' ));
11841184 });
1185+
1186+ test ('leaves relative href resulting in a broken link' , () {
1187+ // Dartdoc does emit a brokenLink warning for this.
1188+ expect (docsAsHtml,
1189+ contains ('<a href="SubForDocComments/localMethod.html">link</a>' ));
1190+ });
1191+
1192+ test ('leaves relative href resulting in a working link' , () {
1193+ // Ideally doc comments should not make assumptions about Dartdoc output
1194+ // files, but unfortunately some do...
1195+ expect (
1196+ docsAsHtml,
1197+ contains (
1198+ '<a href="../SubForDocComments/localMethod.html">link</a>' ));
1199+ });
11851200 });
11861201
11871202 test ('multi-underscore names in brackets do not become italicized' , () {
Original file line number Diff line number Diff line change @@ -887,6 +887,10 @@ class BaseForDocComments {
887887 /// Reference containing a type parameter [ExtraSpecialList<Object>]
888888 ///
889889 /// Reference to something that doesn't exist containing a type parameter [ThisIsNotHereNoWay<MyType>]
890+ ///
891+ /// Link to a nonexistent file (erroneously expects base href): [link] (SubForDocComments/localMethod.html)
892+ ///
893+ /// Link to an existing file: [link] (../SubForDocComments/localMethod.html)
890894 String doAwesomeStuff (int value) => null ;
891895
892896 void anotherMethod () {}
You can’t perform that action at this time.
0 commit comments