diff options
author | Eric Wong <e@80x24.org> | 2024-04-12 02:01:03 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-04-12 09:39:59 +0000 |
commit | 873066744d1b105da4cfafb1c7312ca11b579864 (patch) | |
tree | 88b27dc0cc0f08e7485a2627136a43edf015e761 /t | |
parent | 0aebf0161570b7948cd049f554d76084bf901e09 (diff) | |
download | public-inbox-873066744d1b105da4cfafb1c7312ca11b579864.tar.gz |
This adds support for the "POST /$INBOX/$MSGID/?x=m?q=..." added last year to support per-thread searches 764035c83 (www: support POST /$INBOX/$MSGID/?x=m&q=, 2023-03-30) This only supports instances of public-inbox since 764035c83, but unfortunately there hasn't been a release since then.
Diffstat (limited to 't')
-rw-r--r-- | t/psgi_v2.t | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/t/psgi_v2.t b/t/psgi_v2.t index 54faae9b..d5c328f0 100644 --- a/t/psgi_v2.t +++ b/t/psgi_v2.t @@ -101,6 +101,19 @@ EOM } }; +my $test_lei_q_threadid = sub { + my ($u) = @_; + test_lei(sub { + lei_ok qw(q -f text --only), $u, qw(-T t@1 s:unrelated); + is $lei_out, '', 'no results on unrelated thread'; + lei_ok qw(q -f text --only), $u, qw(-T t@1 dt:19931002000300..); + my @m = ($lei_out =~ m!^Message-ID: <([^>]+)>\n!gms); + is_deeply \@m, ['t@3'], 'got expected result from -T MSGID'; + }); +}; + +$test_lei_q_threadid->($m2t->{inboxdir}); + my $cfgpath = "$ibx->{inboxdir}/pi_config"; { open my $fh, '>', $cfgpath or BAIL_OUT $!; @@ -374,6 +387,9 @@ my $client3 = sub { $res = $cb->(POST("/m2t/t\@1/?q=s:unrelated&x=m")); is($res->code, 404, '404 on cross-thread search'); + + my $rmt = $ENV{PLACK_TEST_EXTERNALSERVER_URI}; + $rmt and $test_lei_q_threadid->("$rmt/m2t/"); }; test_psgi(sub { $www->call(@_) }, $client3); test_httpd($env, $client3, 4); |