@@ -1172,20 +1172,15 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
11721172 });
11731173
11741174 test ('typedef params have proper signature' , () {
1175- // typedef void VoidCallback();
1176- // void addCallback(VoidCallback callback) { }
11771175 ModelFunction function =
11781176 fakeLibrary.functions.firstWhere ((f) => f.name == 'addCallback' );
1179- ElementType t = function.parameters.first.modelType;
11801177 String params = function.linkedParams ();
11811178 expect (
11821179 params,
11831180 '<span class="parameter" id="addCallback-param-callback">'
11841181 '<span class="type-annotation"><a href="fake/VoidCallback.html">VoidCallback</a></span> '
11851182 '<span class="parameter-name">callback</span></span>' );
11861183
1187- // typedef int Callback2(String);
1188- // void addCallback2(Callback2 callback) { }
11891184 function =
11901185 fakeLibrary.functions.firstWhere ((f) => f.name == 'addCallback2' );
11911186 params = function.linkedParams ();
@@ -1216,7 +1211,6 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
12161211 .singleWhere ((f) => f.name == 'explicitSetter' );
12171212 // TODO(jcollins-g): really, these shouldn't be called "parameters" in
12181213 // the span class.
1219- ElementType t = explicitSetter.modelType;
12201214 expect (explicitSetter.linkedReturnType,
12211215 '<span class="parameter" id="explicitSetter=-param-f"><span class="type-annotation">dynamic</span> <span class="parameter-name">Function</span>(<span class="parameter" id="f-param-bar"><span class="type-annotation">int</span>, </span> <span class="parameter" id="f-param-baz"><span class="type-annotation"><a href="fake/Cool-class.html">Cool</a></span>, </span> <span class="parameter" id="f-param-macTruck"><span class="type-annotation">List<span class="signature"><int></span></span></span>)</span>' );
12221216 });
@@ -1293,7 +1287,6 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
12931287 Method aTypedefReturningMethodInterface = TemplatedInterface
12941288 .allInstanceMethods
12951289 .singleWhere ((m) => m.name == 'aTypedefReturningMethodInterface' );
1296- ElementType mt = aTypedefReturningMethodInterface.modelType;
12971290 expect (aTypedefReturningMethodInterface.linkedReturnType,
12981291 '<a href=\" ex/ParameterizedTypedef.html\" >ParameterizedTypedef</a><span class="signature"><List<span class="signature"><String></span>></span>' );
12991292 });
@@ -2234,13 +2227,17 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
22342227 fakeLibrary.classes.firstWhere ((t) => t.name == 'TypedefUsingClass' );
22352228 });
22362229
2237- test ('Typedefs with bound type parameters indirectly referred in parameters are displayed' , () {
2230+ test (
2231+ 'Typedefs with bound type parameters indirectly referred in parameters are displayed' ,
2232+ () {
22382233 Constructor theConstructor = TypedefUsingClass .constructors.first;
2239- expect (theConstructor.linkedParams (), equals ('<span class="parameter" id="-param-x"><span class="type-annotation"><a href="ex/ParameterizedTypedef.html">ParameterizedTypedef</a><span class="signature"><double></span></span> <span class="parameter-name">x</span></span>' ));
2234+ expect (
2235+ theConstructor.linkedParams (),
2236+ equals (
2237+ '<span class="parameter" id="-param-x"><span class="type-annotation"><a href="ex/ParameterizedTypedef.html">ParameterizedTypedef</a><span class="signature"><double></span></span> <span class="parameter-name">x</span></span>' ));
22402238 });
22412239
22422240 test ('anonymous nested functions inside typedefs are handled' , () {
2243- ElementType t = aComplexTypedef.modelType;
22442241 expect (aComplexTypedef, isNotNull);
22452242 expect (aComplexTypedef.linkedReturnType, startsWith ('Function' ));
22462243 expect (aComplexTypedef.nameWithGenerics,
@@ -2371,13 +2368,11 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
23712368 });
23722369
23732370 test ('typedef param is linked and does not include types' , () {
2374- ElementType t = methodWithTypedefParam.parameters.first.modelType;
23752371 var params = methodWithTypedefParam.linkedParams ();
23762372 expect (
23772373 params,
23782374 equals (
23792375 '<span class="parameter" id="methodWithTypedefParam-param-p"><span class="type-annotation"><a href="ex/processMessage.html">processMessage</a></span> <span class="parameter-name">p</span></span>' ));
2380- //expect(params, contains('<a href="ex/processMessage.html">'));
23812376 });
23822377 });
23832378
0 commit comments