X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fmsgmap.t;h=a3b7200f16a566c39041f586c9fc9f97b665de3e;hb=refs%2Fheads%2Fmaster;hp=437e106e3dcd842d4e02866166a9941cdaef061e;hpb=a3391407c960e4bbd825a34b87d053de6ef3767a;p=public-inbox.git diff --git a/t/msgmap.t b/t/msgmap.t index 437e106e..a3b7200f 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; @@ -7,12 +7,13 @@ use PublicInbox::TestCommon; require_mods('DBD::SQLite'); use_ok 'PublicInbox::Msgmap'; my ($tmpdir, $for_destroy) = tmpdir(); -my $d = PublicInbox::Msgmap->new($tmpdir, 1); +my $f = "$tmpdir/msgmap.sqlite3"; +my $d = PublicInbox::Msgmap->new_file($f, 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); @@ -50,7 +51,7 @@ is($d->mid_delete('a@b') + 0, 0, 'delete again returns zero'); is(undef, $d->num_for('a@b'), 'num_for fails on deleted msg'); $d = undef; -ok($d = PublicInbox::Msgmap->new($tmpdir, 1), 'idempotent DB creation'); +ok($d = PublicInbox::Msgmap->new_file($f, 1), 'idempotent DB creation'); my ($min, $max) = $d->minmax; ok($min > 0, "article min OK"); ok($max > 0 && $max < 10, "article max OK");