X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fmsgmap.t;h=437e106e3dcd842d4e02866166a9941cdaef061e;hb=6e2da35b9e9e5510e3156b07e91ebc835146758c;hp=6edeed5645fcef62dcaa92a991e2861dc72df990;hpb=3c313f9034aac96182e2efdc2f92c40803626f32;p=public-inbox.git diff --git a/t/msgmap.t b/t/msgmap.t index 6edeed56..437e106e 100644 --- a/t/msgmap.t +++ b/t/msgmap.t @@ -1,15 +1,10 @@ -# Copyright (C) 2015-2019 all contributors +# Copyright (C) 2015-2020 all contributors # License: AGPL-3.0+ use strict; use warnings; use Test::More; use PublicInbox::TestCommon; - -foreach my $mod (qw(DBD::SQLite)) { - eval "require $mod"; - plan skip_all => "$mod missing for nntpd.t" if $@; -} - +require_mods('DBD::SQLite'); use_ok 'PublicInbox::Msgmap'; my ($tmpdir, $for_destroy) = tmpdir(); my $d = PublicInbox::Msgmap->new($tmpdir, 1); @@ -65,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();