[PATCH 2/2] test for sanitized notmuch-search output

Florian Friesdorf flo at chaoflow.net
Sun May 8 16:13:15 PDT 2011


---
 test/corpus.ccs/cur/1:2, |    8 ++++++++
 test/search-output       |    8 ++++++++
 test/test-lib.sh         |   12 ++++++++++++
 3 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 test/corpus.ccs/cur/1:2,

diff --git a/test/corpus.ccs/cur/1:2, b/test/corpus.ccs/cur/1:2,
new file mode 100644
index 0000000..60081c4
--- /dev/null
+++ b/test/corpus.ccs/cur/1:2,
@@ -0,0 +1,8 @@
+From: "Two =?ISO-8859-1?Q?line=0A_author?=" <two at lineauthor.net>
+To: notmuch at notmuchmail.org
+Date: Tue, 17 Nov 2009 21:28:37 +0600
+Subject: [notmuch] two =?ISO-8859-1?Q?line=0A_subject?=
+	headers
+Message-ID: <123>
+
+body
diff --git a/test/search-output b/test/search-output
index 33ae119..202c13e 100755
--- a/test/search-output
+++ b/test/search-output
@@ -316,4 +316,12 @@ cat <<EOF >EXPECTED
 EOF
 test_expect_equal_file OUTPUT EXPECTED
 
+test_begin_subtest "notmuch search for message with quoted-printable line-breaks in author and subject"
+add_email_corpus_control_char_subject
+notmuch search "*" > OUTPUT
+cat <<EOF >EXPECTED
+thread:0000000000000001   2009-11-17 [1/1] Two line? author; [notmuch] two line? subject headers (inbox unread)
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
 test_done
diff --git a/test/test-lib.sh b/test/test-lib.sh
index eaf5051..0990d91 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -417,6 +417,18 @@ add_email_corpus ()
     fi
 }
 
+add_email_corpus_control_char_subject ()
+{
+    rm -rf ${MAIL_DIR}
+    if [ -d ../corpus.ccs.mail ]; then
+        cp -a ../corpus.ccs.mail ${MAIL_DIR}
+    else
+        cp -a ../corpus.ccs ${MAIL_DIR}
+        notmuch new >/dev/null
+        cp -a ${MAIL_DIR} ../corpus.ccs.mail
+    fi
+}
+
 test_begin_subtest ()
 {
     if [ -n "$inside_subtest" ]; then
-- 
1.7.5.1



More information about the notmuch mailing list