From 4fa659ae950ceed1e0f2331c0b6ec709e6153cf4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Dec 2024 14:58:02 +0000 Subject: [PATCH] t/extindex: add --max-size test I noticed this missing coverage while working on another series of changes which aren't quite ready, yet. --- t/extsearch.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/extsearch.t b/t/extsearch.t index 1a212bc8d..7b75c2083 100644 --- a/t/extsearch.t +++ b/t/extsearch.t @@ -703,4 +703,16 @@ EOF is $args[0]->size, 0, 'isrch->async_mset altid miss works'; } +if ('max-size') { + my $dir = "$home/extindex-max"; + my $rdr = { 2 => \(my $err) }; + ok run_script([qw(-extindex --max-size=500 --all -vvv), $dir], + undef, $rdr), 'extindex with max-size'; + my $es = PublicInbox::ExtSearch->new($dir); + my $mset = $es->mset('z:500..'); + is $mset->size, 0, 'no hits w/ max-size=500'; + like $err, qr/ skipping [a-f0-9]{40,} .*? > 500\b/, + 'noted skipping messages in stderr'; +} + done_testing; -- 2.47.2