Skip to content

Commit

Permalink
chore: fix isolate test that tests sending invalid data, since Dart i…
Browse files Browse the repository at this point in the history
…s 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
  • Loading branch information
knaeckeKami authored Apr 6, 2024
1 parent 3dad149 commit f649590
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/ferry/test/isolate/isolate_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit f649590

Please sign in to comment.