X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fmsgmap.t;h=2d462dfb0fa5952114331ab83266a3a968946469;hb=69b5ab18a594fa434d79cacee35c4d9a0df7b55c;hp=f78070cc959d47db729dbd753e6534550db318aa;hpb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;p=public-inbox.git diff --git a/t/msgmap.t b/t/msgmap.t index f78070cc..2d462dfb 100644 --- a/t/msgmap.t +++ b/t/msgmap.t @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2020 all contributors +# Copyright (C) 2015-2021 all contributors # License: AGPL-3.0+ use strict; use warnings; @@ -12,7 +12,7 @@ my $d = PublicInbox::Msgmap->new($tmpdir, 1); my %mid2num; my %num2mid; my @mids = qw(a@b c@d e@f g@h aa@bb aa@cc); -is_deeply([$d->minmax], [undef,undef], "empty min max on new DB"); +is_deeply([$d->minmax], [0,0], "zero min max on new DB"); foreach my $mid (@mids) { my $n = $d->mid_insert($mid); @@ -60,8 +60,14 @@ my $orig = $d->mid_insert('spam@1'); $d->mid_delete('spam@1'); is($d->mid_insert('spam@2'), 1 + $orig, "last number not recycled"); -my $tmp = $d->tmp_clone; +my $tmp = $d->tmp_clone($tmpdir); is_deeply([$d->minmax], [$tmp->minmax], 'Cloned temporary DB matches'); ok($tmp->mid_delete('spam@2'), 'temporary DB is writable'); +is(eval { + $tmp->atfork_prepare; + $tmp->atfork_parent; + 'ok' +}, 'ok', 'atfork_* work on tmp_clone'); + done_testing();