]> git.notmuchmail.org Git - notmuch/commitdiff
Add a test case for the previous commit.
authorCarl Worth <cworth@cworth.org>
Thu, 3 Jun 2010 23:43:21 +0000 (16:43 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 3 Jun 2010 23:43:21 +0000 (16:43 -0700)
The commit said it fixed a problem with headers >200 characters
long. But examination of the code suggests that it was a header of
exactly 200 characters long that caused the problem. So we add a test
case for that here.

Before the fix in the previous commit, valgrind would detect many
errors when replying to the message created with this test case. After
that commit, those errors are gone.

test/notmuch-test

index a861df16cdcdc8968c2b7d5a41bbec48b9df97e3..ca41408955979c0f10ad8bd45562b7f6be22f439 100755 (executable)
@@ -798,6 +798,22 @@ References: <${gen_msg_id}>
 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
 > Un-munging Reply-To"
 
+printf " Message with header of exactly 200 bytes...\t"
+
+add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \
+            '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
+            '[body]="200-byte header"'
+
+output=$($NOTMUCH reply id:${gen_msg_id})
+pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
+Subject: Re: This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces
+Bcc: test_suite@notmuchmail.org
+In-Reply-To: <${gen_msg_id}>
+References: <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0800, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:
+> 200-byte header"
+
 printf "\nTesting handling of uuencoded data:\n"
 
 add_message [subject]=uuencodetest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \