@@ -1172,20 +1172,15 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
1172
1172
});
1173
1173
1174
1174
test ('typedef params have proper signature' , () {
1175
- // typedef void VoidCallback();
1176
- // void addCallback(VoidCallback callback) { }
1177
1175
ModelFunction function =
1178
1176
fakeLibrary.functions.firstWhere ((f) => f.name == 'addCallback' );
1179
- ElementType t = function.parameters.first.modelType;
1180
1177
String params = function.linkedParams ();
1181
1178
expect (
1182
1179
params,
1183
1180
'<span class="parameter" id="addCallback-param-callback">'
1184
1181
'<span class="type-annotation"><a href="fake/VoidCallback.html">VoidCallback</a></span> '
1185
1182
'<span class="parameter-name">callback</span></span>' );
1186
1183
1187
- // typedef int Callback2(String);
1188
- // void addCallback2(Callback2 callback) { }
1189
1184
function =
1190
1185
fakeLibrary.functions.firstWhere ((f) => f.name == 'addCallback2' );
1191
1186
params = function.linkedParams ();
@@ -1216,7 +1211,6 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
1216
1211
.singleWhere ((f) => f.name == 'explicitSetter' );
1217
1212
// TODO(jcollins-g): really, these shouldn't be called "parameters" in
1218
1213
// the span class.
1219
- ElementType t = explicitSetter.modelType;
1220
1214
expect (explicitSetter.linkedReturnType,
1221
1215
'<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>' );
1222
1216
});
@@ -1293,7 +1287,6 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
1293
1287
Method aTypedefReturningMethodInterface = TemplatedInterface
1294
1288
.allInstanceMethods
1295
1289
.singleWhere ((m) => m.name == 'aTypedefReturningMethodInterface' );
1296
- ElementType mt = aTypedefReturningMethodInterface.modelType;
1297
1290
expect (aTypedefReturningMethodInterface.linkedReturnType,
1298
1291
'<a href=\" ex/ParameterizedTypedef.html\" >ParameterizedTypedef</a><span class="signature"><List<span class="signature"><String></span>></span>' );
1299
1292
});
@@ -2234,13 +2227,17 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
2234
2227
fakeLibrary.classes.firstWhere ((t) => t.name == 'TypedefUsingClass' );
2235
2228
});
2236
2229
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
+ () {
2238
2233
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>' ));
2240
2238
});
2241
2239
2242
2240
test ('anonymous nested functions inside typedefs are handled' , () {
2243
- ElementType t = aComplexTypedef.modelType;
2244
2241
expect (aComplexTypedef, isNotNull);
2245
2242
expect (aComplexTypedef.linkedReturnType, startsWith ('Function' ));
2246
2243
expect (aComplexTypedef.nameWithGenerics,
@@ -2371,13 +2368,11 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
2371
2368
});
2372
2369
2373
2370
test ('typedef param is linked and does not include types' , () {
2374
- ElementType t = methodWithTypedefParam.parameters.first.modelType;
2375
2371
var params = methodWithTypedefParam.linkedParams ();
2376
2372
expect (
2377
2373
params,
2378
2374
equals (
2379
2375
'<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">'));
2381
2376
});
2382
2377
});
2383
2378
0 commit comments