@@ -936,7 +936,9 @@ void main() {
936
936
});
937
937
938
938
test ('does not have a null safety label if not null safe' , () {
939
- expect (exLibrary.isNullSafety, isFalse);
939
+ var optOutLibrary = packageGraph.libraries
940
+ .firstWhere ((lib) => lib.name == 'opt_out_of_nnbd' );
941
+ expect (optOutLibrary.isNullSafety, isFalse);
940
942
});
941
943
942
944
test ('has a line number and column' , () {
@@ -3381,7 +3383,7 @@ void main() {
3381
3383
expect (
3382
3384
thisIsFutureOrT.modelType.returnType.linkedName,
3383
3385
equals (
3384
- 'FutureOr<span class="signature"><<wbr><span class="type-parameter">T</span>></span>' ));
3386
+ 'FutureOr<span class="signature"><<wbr><span class="type-parameter">T</span>></span>? ' ));
3385
3387
});
3386
3388
3387
3389
test ('function with a parameter having type FutureOr<Null>' , () {
@@ -3417,7 +3419,7 @@ void main() {
3417
3419
test ('has source code' , () {
3418
3420
expect (topLevelFunction.sourceCode, startsWith ('@deprecated' ));
3419
3421
expect (topLevelFunction.sourceCode, endsWith ('''
3420
- String topLevelFunction(int param1, bool param2, Cool coolBeans,
3422
+ String? topLevelFunction(int param1, bool param2, Cool coolBeans,
3421
3423
[double optionalPositional = 0.0]) {
3422
3424
return null;
3423
3425
}''' ));
@@ -3486,15 +3488,19 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
3486
3488
test ('parameterized type from field is correctly displayed' , () {
3487
3489
var aField = TemplatedInterface .instanceFields
3488
3490
.singleWhere ((f) => f.name == 'aField' );
3489
- expect (aField.modelType.linkedName,
3490
- '<a href="${htmlBasePlaceholder }ex/AnotherParameterizedClass-class.html">AnotherParameterizedClass</a><span class="signature"><<wbr><span class="type-parameter">Stream<span class="signature"><<wbr><span class="type-parameter">List<span class="signature"><<wbr><span class="type-parameter">int</span>></span></span>></span></span>></span>' );
3491
+ expect (
3492
+ aField.modelType.linkedName,
3493
+ '<a href="${htmlBasePlaceholder }ex/AnotherParameterizedClass-class.html">AnotherParameterizedClass</a>'
3494
+ '<span class="signature"><<wbr><span class="type-parameter">Stream<span class="signature"><<wbr><span class="type-parameter">List<span class="signature"><<wbr><span class="type-parameter">int</span>></span></span>></span></span>></span>?' );
3491
3495
});
3492
3496
3493
3497
test ('parameterized type from inherited field is correctly displayed' , () {
3494
3498
var aInheritedField = TemplatedInterface .inheritedFields
3495
3499
.singleWhere ((f) => f.name == 'aInheritedField' );
3496
- expect (aInheritedField.modelType.linkedName,
3497
- '<a href="${htmlBasePlaceholder }ex/AnotherParameterizedClass-class.html">AnotherParameterizedClass</a><span class="signature"><<wbr><span class="type-parameter">List<span class="signature"><<wbr><span class="type-parameter">int</span>></span></span>></span>' );
3500
+ expect (
3501
+ aInheritedField.modelType.linkedName,
3502
+ '<a href="${htmlBasePlaceholder }ex/AnotherParameterizedClass-class.html">AnotherParameterizedClass</a>'
3503
+ '<span class="signature"><<wbr><span class="type-parameter">List<span class="signature"><<wbr><span class="type-parameter">int</span>></span></span>></span>?' );
3498
3504
});
3499
3505
3500
3506
test (
@@ -3751,7 +3757,7 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
3751
3757
3752
3758
test ('method source code indents correctly' , () {
3753
3759
expect (convertToMap.sourceCode,
3754
- 'Map<X, Y> convertToMap() => null;' );
3760
+ 'Map<X, Y>? convertToMap() => null;' );
3755
3761
});
3756
3762
});
3757
3763
@@ -4283,7 +4289,7 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
4283
4289
expect (
4284
4290
genericTypedefCombo.modelType.linkedName,
4285
4291
equals (
4286
- '<a href="%%__HTMLBASE_dartdoc_internal__%%fake/NewGenericTypedef.html">NewGenericTypedef</a>' ));
4292
+ '<a href="%%__HTMLBASE_dartdoc_internal__%%fake/NewGenericTypedef.html">NewGenericTypedef</a>? ' ));
4287
4293
});
4288
4294
4289
4295
test ('Verify that final and late show up (or not) appropriately' , () {
@@ -4323,7 +4329,8 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
4323
4329
expect (
4324
4330
complicatedReturn.modelType.linkedName,
4325
4331
equals (
4326
- '<a href="${htmlBasePlaceholder }fake/ATypeTakingClass-class.html">ATypeTakingClass</a><span class="signature"><<wbr><span class="type-parameter">String Function<span class="signature">(<span class="parameter" id="param-"><span class="type-annotation">int</span></span>)</span></span>></span>' ));
4332
+ '<a href="${htmlBasePlaceholder }fake/ATypeTakingClass-class.html">ATypeTakingClass</a>'
4333
+ '<span class="signature"><<wbr><span class="type-parameter">String Function<span class="signature">(<span class="parameter" id="param-"><span class="type-annotation">int</span></span>)</span></span>></span>?' ));
4327
4334
});
4328
4335
4329
4336
test ('@nodoc on simple property works' , () {
@@ -4878,7 +4885,7 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
4878
4885
4879
4886
test ('param with annotations' , () {
4880
4887
var method =
4881
- fakeLibrary.functions.firstWhere ((f) => f.name == 'paintImage1 ' );
4888
+ fakeLibrary.functions.firstWhere ((f) => f.name == 'paintImage2 ' );
4882
4889
var params =
4883
4890
ParameterRendererHtml ().renderLinkedParams (method.parameters);
4884
4891
expect (
@@ -5104,16 +5111,18 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
5104
5111
});
5105
5112
5106
5113
test ('Property fields are terminated with semicolon' , () {
5107
- expect (finalProperty.sourceCode.trim (), endsWith ('List<int>();' ));
5108
- expect (simpleProperty.sourceCode.trim (), endsWith ('List<int>();' ));
5114
+ expect (finalProperty.sourceCode.trim (),
5115
+ endsWith ('List<int>.filled(1, 1);' ));
5116
+ expect (simpleProperty.sourceCode.trim (),
5117
+ endsWith ('List<int>.filled(1, 1);' ));
5109
5118
expect (forInheriting.sourceCode.trim (), endsWith ('forInheriting;' ));
5110
5119
});
5111
5120
5112
5121
test ('Arrow accessors are terminated with semicolon' , () {
5113
5122
expect (explicitGetterImplicitSetter.getter.sourceCode.trim (),
5114
- endsWith ('List<int>( );' ));
5123
+ endsWith ('List<int>.filled(1, 1 );' ));
5115
5124
expect (explicitGetterSetter.getter.sourceCode.trim (),
5116
- endsWith ('List<int>( );' ));
5125
+ endsWith ('List<int>.filled(1, 1 );' ));
5117
5126
});
5118
5127
5119
5128
test ('Traditional accessors are not terminated with semicolon' , () {
@@ -5124,7 +5133,7 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
5124
5133
5125
5134
test ('Whole declaration is visible when declaration spans many lines' , () {
5126
5135
expect (ensureWholeDeclarationIsVisible.sourceCode,
5127
- contains ('List<int> ' ));
5136
+ contains ('List<int>? ' ));
5128
5137
});
5129
5138
});
5130
5139
0 commit comments