Skip to content

Commit 0714b95

Browse files
committed
more tests
1 parent 4c4316d commit 0714b95

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

test/dartdoc_test_base.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract class DartdocTestBase {
4040

4141
String get sdkConstraint => '>=3.3.0 <4.0.0';
4242

43-
List<String> get experiments => ['wildcards'];
43+
List<String> get experiments => ['wildcard-variables'];
4444

4545
bool get skipUnreachableSdkLibraries => true;
4646

test/parameter_test.dart

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,48 @@ class A {
243243
'''));
244244
}
245245

246-
void test_superConstructorParameter_fieldFormal() async {
246+
void test_fieldFormalParameter_referenced() async {
247+
var library = await bootPackageWithLibrary('''
248+
class C {
249+
int p;
250+
/// Text [p].
251+
C(this.p);
252+
}
253+
''');
254+
var cConstructor = library.classes.named('C').constructors.named('C');
255+
// There is no link, but also no wrong link or crash.
256+
expect(cConstructor.documentationAsHtml, '<p>Text <code>p</code>.</p>');
257+
}
258+
259+
void test_fieldFormalParameter_referenced_wildcard() async {
260+
var library = await bootPackageWithLibrary('''
261+
class C {
262+
int _;
263+
/// Text [_].
264+
C(this._);
265+
}
266+
''');
267+
var cConstructor = library.classes.named('C').constructors.named('C');
268+
// There is no link, but also no wrong link or crash.
269+
expect(cConstructor.documentationAsHtml, '<p>Text <code>_</code>.</p>');
270+
}
271+
272+
void test_superParameter_referenced_wildcard() async {
273+
var library = await bootPackageWithLibrary('''
274+
class C {
275+
C(int _);
276+
}
277+
class D extends C {
278+
/// Text [_].
279+
D(super._) {}
280+
}
281+
''');
282+
var dConstructor = library.classes.named('D').constructors.named('D');
283+
// There is no link, but also no wrong link or crash.
284+
expect(dConstructor.documentationAsHtml, '<p>Text <code>_</code>.</p>');
285+
}
286+
287+
void test_superParameter_fieldFormal() async {
247288
var library = await bootPackageWithLibrary('''
248289
class C {
249290
int f;
@@ -265,7 +306,7 @@ class D extends C {
265306
'''));
266307
}
267308

268-
void test_superConstructorParameter_isSubtype() async {
309+
void test_superParameter_isSubtype() async {
269310
var library = await bootPackageWithLibrary('''
270311
class C {
271312
C.positionalNum(num g);
@@ -286,7 +327,7 @@ class D extends C {
286327
'''));
287328
}
288329

289-
void test_superConstructorParameter_superParameter() async {
330+
void test_superParameter_superParameter() async {
290331
var library = await bootPackageWithLibrary('''
291332
class C {
292333
C.requiredPositional(int a);

0 commit comments

Comments
 (0)