From f649590b674b550f53688247e5968c1279ef6e45 Mon Sep 17 00:00:00 2001 From: Martin Kamleithner Date: Sat, 6 Apr 2024 22:42:43 +0100 Subject: [PATCH] chore: fix isolate test that tests sending invalid data, since Dart is much more lenient now (#590) * chore: fix isolate test that tests sending invalid data, since Dart is much more lenient now * chore: fix isolate test that tests sending invalid data, since Dart is much more lenient now --- packages/ferry/test/isolate/isolate_client_test.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/ferry/test/isolate/isolate_client_test.dart b/packages/ferry/test/isolate/isolate_client_test.dart index e5f9d060..311fcb2c 100644 --- a/packages/ferry/test/isolate/isolate_client_test.dart +++ b/packages/ferry/test/isolate/isolate_client_test.dart @@ -314,15 +314,17 @@ void main() { _initAutoResponderForReviewsLinkClient, params: null); - void localFunc() {} + final receivePort = ReceivePort(); addTearDown(client.dispose); + addTearDown(receivePort.close); //closure that captures local state, cannot be sent to isolate final invalidMergeReviews = (GReviewsData? previousResult, GReviewsData? fetchMoreResult) { - // try to call this locally declared function - // -> this will make the invalidMergeReviews non-transmittable for sure - localFunc(); + // try to reference receivePort, which is a closure variable + // with native function type, which cannot be sent to isolate + // so sending this function through isolate will throw an error + receivePort.runtimeType; return null; };