]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/lei-index: ignore {pct} in m: vs mid: queries master
authorEric Wong <e@80x24.org>
Thu, 23 Jul 2026 05:50:53 +0000 (05:50 +0000)
committerEric Wong <e@80x24.org>
Thu, 23 Jul 2026 23:46:03 +0000 (23:46 +0000)
Xapian 2.0.0 appears to score m: (probabilistic) and mid: (boolean)
matches differently than the 1.4.x series.  This seems to make
sense since boolean matches score higher (as expected), so
adjust our case to stop caring about the result of ->get_percent
between different queries.

This behavior was confirmed with Xapian 2.0 on both Debian
sid/rc-buggy and FreeBSD 15.

t/lei-index.t

index 2b28f1be5ae950cfd5aae59127d14430ba108238..3111926db31502d8fd2af0511f91fafa1f78a955 100644 (file)
@@ -70,7 +70,8 @@ test_lei({ tmpdir => $tmpdir }, sub {
                'imported blob');
        lei_ok(qw(q m:qp@example.com --dedupe=none));
        my $res_b = json_utf8->decode($lei_out);
-       is_deeply($res_b, $res_a, 'no extra DB entries');
+       delete $_->[0]->{pct} for ($res_a, $res_b);
+       is_xdeeply $res_b, $res_a, 'no extra DB entries';
 
        # ensure tag works on index-only messages:
        lei_ok(qw(tag +kw:seen t/utf8.eml));