From 6082492b14ee2a24b0131ce0a99b26ee316a4d88 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 19 Sep 2021 12:50:20 +0000 Subject: ipc: wq_do: support synchronous waits and responses This brings the wq_* SOCK_SEQPACKET API functionality on par with the ipc_do (pipe-based) API. --- t/ipc.t | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't') diff --git a/t/ipc.t b/t/ipc.t index 7983fdc0..202b1cc6 100644 --- a/t/ipc.t +++ b/t/ipc.t @@ -161,6 +161,12 @@ SKIP: { is(waitpid($pid, 0), $pid, 'waitpid complete'); is($?, 0, 'child wq producer exited'); } + my @ary = $ipc->wq_do('test_array'); + is_deeply(\@ary, [ qw(test array) ], 'wq_do wantarray'); + is(my $s = $ipc->wq_do('test_scalar'), 'scalar', 'defined wantarray'); + my $exp = bless ['blessed'], 'PublicInbox::WTF'; + my $ret = eval { $ipc->wq_do('test_die', $exp) }; + is_deeply($@, $exp, 'die with blessed ref'); } $ipc->wq_close; -- cgit v1.2.3-24-ge0c7