@@ -1904,7 +1904,7 @@ void main() {
19041904 });
19051905
19061906 test ('correctly finds all the classes' , () {
1907- expect (classes, hasLength (31 ));
1907+ expect (classes, hasLength (33 ));
19081908 });
19091909
19101910 test ('abstract' , () {
@@ -2114,15 +2114,37 @@ void main() {
21142114
21152115 group ('Extension' , () {
21162116 Extension ext, fancyList;
2117- Method s;
2117+ Class extensionReferencer;
2118+ Method doSomeStuff, doStuff, s;
21182119 List <Extension > extensions;
21192120
21202121 setUpAll (() {
21212122 ext = exLibrary.extensions.firstWhere ((e) => e.name == 'AppleExtension' );
2123+ extensionReferencer = exLibrary.classes.firstWhere ((c) => c.name == 'ExtensionReferencer' );
21222124 fancyList = exLibrary.extensions.firstWhere ((e) => e.name == 'FancyList' );
2125+ doSomeStuff = exLibrary.classes.firstWhere ((c) => c.name == 'ExtensionUser' )
2126+ .allInstanceMethods.firstWhere ((m) => m.name == 'doSomeStuff' );
2127+ doStuff = exLibrary.extensions.firstWhere ((e) => e.name == 'SimpleStringExtension' )
2128+ .instanceMethods.firstWhere ((m) => m.name == 'doStuff' );
21232129 extensions = exLibrary.publicExtensions.toList ();
21242130 });
21252131
2132+ // TODO(jcollins-g): implement feature and update tests
2133+ test ('documentation links do not crash in base cases' , () {
2134+ packageGraph.packageWarningCounter.hasWarning (doStuff, PackageWarning .notImplemented,
2135+ 'Comment reference resolution inside extension methods is not yet implemented' );
2136+ packageGraph.packageWarningCounter.hasWarning (doSomeStuff, PackageWarning .notImplemented,
2137+ 'Comment reference resolution inside extension methods is not yet implemented' );
2138+ expect (doStuff.documentationAsHtml, contains ('<code>another</code>' ));
2139+ expect (doSomeStuff.documentationAsHtml, contains ('<code>String.extensionNumber</code>' ));
2140+ });
2141+
2142+ test ('references from outside an extension refer correctly to the extension' , () {
2143+ expect (extensionReferencer.documentationAsHtml, contains ('<code>_Shhh</code>' ));
2144+ expect (extensionReferencer.documentationAsHtml, contains ('<a href="ex/FancyList.html">FancyList</a>' ));
2145+ expect (extensionReferencer.documentationAsHtml, contains ('<a href="ex/AnExtension/call.html">AnExtension.call</a>' ));
2146+ });
2147+
21262148 test ('has a fully qualified name' , () {
21272149 expect (ext.fullyQualifiedName, 'ex.AppleExtension' );
21282150 });
@@ -2179,11 +2201,11 @@ void main() {
21792201 });
21802202
21812203 test ('correctly finds all the extensions' , () {
2182- expect (exLibrary.extensions, hasLength (7 ));
2204+ expect (exLibrary.extensions, hasLength (8 ));
21832205 });
21842206
21852207 test ('correctly finds all the public extensions' , () {
2186- expect (extensions, hasLength (5 ));
2208+ expect (extensions, hasLength (6 ));
21872209 });
21882210 });
21892211
0 commit comments