From af0331d501120eca7eb9cbe35eb4135293b32b58 Mon Sep 17 00:00:00 2001 From: Trevor Wang Date: Mon, 30 Dec 2024 17:04:05 +0800 Subject: [PATCH] fix: fix test --- generator/test/src/generator_test_src.dart | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/generator/test/src/generator_test_src.dart b/generator/test/src/generator_test_src.dart index ba7a7b27..054bfbd8 100644 --- a/generator/test/src/generator_test_src.dart +++ b/generator/test/src/generator_test_src.dart @@ -5,19 +5,19 @@ import 'package:source_gen_test/annotations.dart'; import 'query.pb.dart'; class Resource {} + class MockCallAdapter1 extends CallAdapter, Future>> { @override Future> adapt(Future Function() call) async { return Resource(); } } + @ShouldGenerate( -''' + ''' @override Future>> getUser() { - return MockCallAdapter1>().adapt( - () => _getUser(), - ); + return MockCallAdapter1>().adapt(() => _getUser()); } ''', contains: true, @@ -30,19 +30,20 @@ abstract class TestCallAdapter1 { } class Either {} -class MockCallAdapter2 extends CallAdapter, Future>> { + +class MockCallAdapter2 + extends CallAdapter, Future>> { @override Future> adapt(Future Function() call) async { return Either(); } } + @ShouldGenerate( -''' + ''' @override Future> getUser() { - return MockCallAdapter2().adapt( - () => _getUser(), - ); + return MockCallAdapter2().adapt(() => _getUser()); } ''', contains: true, @@ -55,19 +56,19 @@ abstract class TestCallAdapter2 { } class Flow {} + class MockCallAdapter3 extends CallAdapter, Flow> { @override Flow adapt(Future Function() call) { return Flow(); } } + @ShouldGenerate( -''' + ''' @override Flow getUser() { - return MockCallAdapter3().adapt( - () => _getUser(), - ); + return MockCallAdapter3().adapt(() => _getUser()); } ''', contains: true, @@ -92,7 +93,9 @@ class Config { final bool shouldReplace; final Map subConfig; } + enum FileType { mp4, mp3 } + class DummyTypedExtras extends TypedExtras { const DummyTypedExtras({ required this.id,