@@ -3583,8 +3583,7 @@ void main() {
35833583 expect (mocksContent, contains ('implements _i2.Baz' ));
35843584 });
35853585
3586- test (
3587- 'when a type parameter is a typedef a function which returns another type' ,
3586+ test ('when its a type parameter of function which returns another type' ,
35883587 () async {
35893588 final mocksContent = await buildWithNonNullable ({
35903589 ...annotationsAsset,
@@ -3610,6 +3609,34 @@ void main() {
36103609 '''
36113610 });
36123611
3612+ expect (mocksContent, contains ('class MockFoo extends _i1.Mock' ));
3613+ expect (mocksContent, contains ('implements _i2.Foo' ));
3614+ });
3615+ test ('when its a duplicate type parameter' , () async {
3616+ final mocksContent = await buildWithNonNullable ({
3617+ ...annotationsAsset,
3618+ 'foo|lib/foo.dart' : dedent (r'''
3619+ class Bar {}
3620+ typedef BarDef = int Function();
3621+ typedef BarDef2 = int Function();
3622+ class BaseFoo<T,P> {
3623+ BaseFoo(this.t1, this.t2);
3624+ final T t1;
3625+ final P t2;
3626+ }
3627+ class Foo extends BaseFoo<BarDef, BarDef2> {
3628+ Foo() : super(() => 1, () => 2);
3629+ }
3630+ ''' ),
3631+ 'foo|test/foo_test.dart' : '''
3632+ import 'package:foo/foo.dart';
3633+ import 'package:mockito/annotations.dart';
3634+
3635+ @GenerateMocks([Foo])
3636+ void main() {}
3637+ '''
3638+ });
3639+
36133640 expect (mocksContent, contains ('class MockFoo extends _i1.Mock' ));
36143641 expect (mocksContent, contains ('implements _i2.Foo' ));
36153642 });
0 commit comments