#!perl -w
-# Copyright (C) 2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use v5.10.1;
is((values %lines)[0], 2, '2 hits on same line number');
is($err, $exp, "$x die matches");
is($ret, undef, "$x die did not return");
+
+ eval { $ipc->test_die(['arrayref']) };
+ $exp = $@;
+ $ret = eval { $ipc->ipc_do('test_die', ['arrayref']) };
+ $err = $@;
+ is_deeply($err, $exp, 'die with unblessed ref');
+ is(ref($err), 'ARRAY', 'got an array ref');
+
+ $exp = bless ['blessed'], 'PublicInbox::WTF';
+ $ret = eval { $ipc->ipc_do('test_die', $exp) };
+ $err = $@;
+ is_deeply($err, $exp, 'die with blessed ref');
+ is(ref($err), 'PublicInbox::WTF', 'got blessed ref');
};
$test->('local');
SKIP: {
- require_mods(qw(Storable), 16);
+ require_mods(qw(Storable||Sereal), 16);
my $pid = $ipc->ipc_worker_spawn('test worker');
ok($pid > 0 && kill(0, $pid), 'worker spawned and running');
defined($pid) or BAIL_OUT 'no spawn, no test';