]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/ipc.t
ipc: wq_do: support synchronous waits and responses
[public-inbox.git] / t / ipc.t
diff --git a/t/ipc.t b/t/ipc.t
index 7983fdc02ef1bcffcd479e860b2c92dd0c7c8dba..202b1cc658df533b1a52b44676a19389808081a5 100644 (file)
--- 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;