paramOfFutureOrNull function
+ +Has a parameter explicitly typed FutureOr<Null>
.
diff --git a/test/model_test.dart b/test/model_test.dart index 8728eaa97a..cc9f6895ff 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -6,7 +6,6 @@ library dartdoc.model_test; import 'dart:io'; -import 'package:analyzer/dart/element/element.dart'; import 'package:dartdoc/dartdoc.dart'; import 'package:dartdoc/src/model.dart'; import 'package:dartdoc/src/warnings.dart'; @@ -1048,18 +1047,33 @@ void main() { group('Function', () { ModelFunction f1; ModelFunction genericFunction; + ModelFunction paramOfFutureOrNull; ModelFunction thisIsAsync; + ModelFunction thisIsFutureOr; + ModelFunction thisIsFutureOrNull; + ModelFunction thisIsFutureOrT; ModelFunction topLevelFunction; + ModelFunction typeParamOfFutureOr; setUp(() { f1 = exLibrary.functions.first; genericFunction = exLibrary.functions.firstWhere((f) => f.name == 'genericFunction'); + paramOfFutureOrNull = + fakeLibrary.functions.firstWhere((f) => f.name == 'paramOfFutureOrNull'); thisIsAsync = fakeLibrary.functions.firstWhere((f) => f.name == 'thisIsAsync'); + thisIsFutureOr = + fakeLibrary.functions.firstWhere((f) => f.name == 'thisIsFutureOr'); + thisIsFutureOrNull = + fakeLibrary.functions.firstWhere((f) => f.name == 'thisIsFutureOrNull'); + thisIsFutureOrT = + fakeLibrary.functions.firstWhere((f) => f.name == 'thisIsFutureOrT'); topLevelFunction = fakeLibrary.functions.firstWhere((f) => f.name == 'topLevelFunction'); - }); + typeParamOfFutureOr = + fakeLibrary.functions.firstWhere((f) => f.name == 'typeParamOfFutureOr'); + }); test('has a fully qualified name', () { expect(thisIsAsync.fullyQualifiedName, 'fake.thisIsAsync'); @@ -1102,6 +1116,29 @@ void main() { '
An async function. It should look like I return a Future
.
FooBar
comes from another library.
+FutureOr<Null>
.
+
Future
.
+FutureOr
.
+
+FutureOr<Null>
.
+
+FutureOr<T>
.
+
FutureOr<List>
.
+
Has a parameter explicitly typed FutureOr<Null>
.
Explicitly return a FutureOr
.
Explicitly return a FutureOr<Null>
.
Explicitly return a FutureOr<T>
.
Has a type parameter bound to FutureOr<List>
.