]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/extindex: add --max-size test
authorEric Wong <e@80x24.org>
Sat, 14 Dec 2024 14:58:02 +0000 (14:58 +0000)
committerEric Wong <e@80x24.org>
Wed, 18 Dec 2024 21:42:15 +0000 (21:42 +0000)
I noticed this missing coverage while working on another
series of changes which aren't quite ready, yet.

t/extsearch.t

index 1a212bc8db07c8038f4ea31d38d0eeaa733ebb15..7b75c2083dca4dd97622a00198e62b8b4d005c24 100644 (file)
@@ -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;