test: add test for sanitized notmuch-search output
authorFlorian Friesdorf <flo@chaoflow.net>
Sun, 8 May 2011 23:13:15 +0000 (01:13 +0200)
committerCarl Worth <cworth@cworth.org>
Thu, 2 Jun 2011 04:58:16 +0000 (21:58 -0700)
This feature was recently added, so it of course needs a test now.

Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
Edited-by: Carl Worth <cworth@cworth.org> Fixed test to use
notmuch_search_sanitize in order to be robust against unpredictable
thread ID numbers, (due to unpredictable order in which the filesystem
presents files).

test/search-output

index 13f9613065761985dcdd7bfef9724bf0e27bc54c..5658dceec130b8c80cec56639c4096f634831185 100755 (executable)
@@ -304,6 +304,15 @@ cat <<EOF >EXPECTED
 EOF
 test_expect_equal_file OUTPUT EXPECTED
 
+test_begin_subtest "santize output for quoted-printable line-breaks in author and subject"
+add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?=
+       headers'"
+notmuch search id:"$gen_msg_id" | notmuch_search_sanitize >OUTPUT
+cat <<EOF >EXPECTED
+thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; two line? subject headers (inbox unread)
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
 test_begin_subtest "notmuch search for non-existent message prints nothing"
 notmuch search "no-message-matches-this" > OUTPUT
 echo -n >EXPECTED