diff options
author | Eric Wong <e@yhbt.net> | 2020-06-10 07:05:12 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-06-13 07:55:45 +0000 |
commit | d0dcab33e0b02bf3299deea40f96ef5fff10fe73 (patch) | |
tree | 2c0343463544400798fb73e7567978cb83af116b /t | |
parent | 56e4554469fb86c2cac63d9eabaffa64c531e835 (diff) | |
download | public-inbox-d0dcab33e0b02bf3299deea40f96ef5fff10fe73.tar.gz |
We can get exact values for EXISTS, UIDNEXT using SQLite rather than calculating off $ibx->mm->max ourselves. Furthermore, $ibx->mm is less useful than $ibx->over for IMAP (and for our read-only daemons in general) so do not depend on $ibx->mm outside of startup/reload to save FDs and reduce kernel page cache footprint.
Diffstat (limited to 't')
-rw-r--r-- | t/over.t | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -10,6 +10,8 @@ use_ok 'PublicInbox::OverIdx'; my ($tmpdir, $for_destroy) = tmpdir(); my $over = PublicInbox::OverIdx->new("$tmpdir/over.sqlite3"); $over->connect; +is($over->max, 0, 'max is zero on new DB (scalar context)'); +is_deeply([$over->max], [0], 'max is zero on new DB (list context)'); my $x = $over->next_tid; is(int($x), $x, 'integer tid'); my $y = $over->next_tid; @@ -58,6 +60,7 @@ foreach my $mid (qw(a b)) { my $msgs = [ map { $_->{num} } @{$over->get_thread($mid)} ]; is_deeply([98, 99], $msgs, "linked messages by Message-ID: <$mid>"); } +isnt($over->max, 0, 'max is non-zero'); $over->rollback_lazy; |