@@ -3583,8 +3583,7 @@ void main() {
3583
3583
expect (mocksContent, contains ('implements _i2.Baz' ));
3584
3584
});
3585
3585
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' ,
3588
3587
() async {
3589
3588
final mocksContent = await buildWithNonNullable ({
3590
3589
...annotationsAsset,
@@ -3610,6 +3609,34 @@ void main() {
3610
3609
'''
3611
3610
});
3612
3611
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
+
3613
3640
expect (mocksContent, contains ('class MockFoo extends _i1.Mock' ));
3614
3641
expect (mocksContent, contains ('implements _i2.Foo' ));
3615
3642
});
0 commit comments