user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/2] t/psgi_search: test for subject-free messages
  2020-01-30  9:19  5% [PATCH 0/2] subject-free tests and updates Eric Wong
@ 2020-01-30  9:19  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-01-30  9:19 UTC (permalink / raw)
  To: meta

Apparently I fixed this bug a while back in commit
f94c3a195a25a31d0215cd175938008fca473378 but did
not write tests.
---
 t/psgi_search.t | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/t/psgi_search.t b/t/psgi_search.t
index 5310e5ab..56b42118 100644
--- a/t/psgi_search.t
+++ b/t/psgi_search.t
@@ -27,16 +27,32 @@ my $im = $ibx->importer(0);
 my $digits = '10010260936330';
 my $ua = 'Pine.LNX.4.10';
 my $mid = "$ua.$digits.2460-100000\@penguin.transmeta.com";
-my $data = <<"EOF";
+my $mime = PublicInbox::MIME->new(<<EOF);
 Subject: test
 Message-ID: <$mid>
 From: Ævar Arnfjörð Bjarmason <avarab\@example>
 To: git\@vger.kernel.org
 
 EOF
+$im->add($mime);
+
+$mime = PublicInbox::MIME->new(<<'EOF');
+Subject:
+Message-ID: <blank-subject@example.com>
+From: blank subject <blank-subject@example.com>
+To: git@vger.kernel.org
+
+EOF
+$im->add($mime);
 
-my $mime = Email::MIME->new(\$data);
+$mime = PublicInbox::MIME->new(<<'EOF');
+Message-ID: <no-subject-at-all@example.com>
+From: no subject at all <no-subject-at-all@example.com>
+To: git@vger.kernel.org
+
+EOF
 $im->add($mime);
+
 $im->done;
 PublicInbox::SearchIdx->new($ibx, 1)->index_sync;
 
@@ -78,6 +94,19 @@ test_psgi(sub { $www->call(@_) }, sub {
 		like($res->content, $mid_re, 'found mid in response');
 		chop($digits);
 	}
+
+	$res = $cb->(GET('/test/'));
+	$html = $res->content;
+	like($html, qr/\bhref="no-subject-at-all[^>]+>\(no subject\)</,
+		'subject-less message linked from "/$INBOX/"');
+	like($html, qr/\bhref="blank-subject[^>]+>\(no subject\)</,
+		'blank subject message linked from "/$INBOX/"');
+
+	$res = $cb->(GET('/test/?q=tc:git'));
+	like($html, qr/\bhref="no-subject-at-all[^>]+>\(no subject\)</,
+		'subject-less message linked from "/$INBOX/?q=..."');
+	like($html, qr/\bhref="blank-subject[^>]+>\(no subject\)</,
+		'blank subject message linked from "/$INBOX/?q=..."');
 });
 
 done_testing();

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/2] subject-free tests and updates
@ 2020-01-30  9:19  5% Eric Wong
  2020-01-30  9:19  7% ` [PATCH 1/2] t/psgi_search: test for subject-free messages Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-01-30  9:19 UTC (permalink / raw)
  To: meta

Odd cases need more coverage...

Eric Wong (2):
  t/psgi_search: test for subject-free messages
  mboxgz: ensure gzipped mboxes always have filenames

 lib/PublicInbox/MboxGz.pm | 10 ++++------
 t/psgi_search.t           | 39 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 41 insertions(+), 8 deletions(-)

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-01-30  9:19  5% [PATCH 0/2] subject-free tests and updates Eric Wong
2020-01-30  9:19  7% ` [PATCH 1/2] t/psgi_search: test for subject-free messages Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).