[PATCH 10/23] test: test parsing of malformed from addresses

David Bremner david at tethera.net
Sat Jun 3 10:47:41 PDT 2017


This was previously tested in T200-thread-naming.sh, but failures due
to changes in address parsing were confusing because they had nothing
to do with threads.
---
 test/T050-new.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/T050-new.sh b/test/T050-new.sh
index ffa303ef..66235306 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -140,6 +140,13 @@ ln -s "$external_msg_filename" "$gen_msg_filename"
 output=$(NOTMUCH_NEW --debug)
 test_expect_equal "$output" "Added 1 new message to the database."
 
+test_begin_subtest "Index malformed from address."
+test_subtest_broken_gmime_3
+add_message '[subject]="test subject"' \
+            '[date]="Sat, 13 Jan 2001 15:43:45 -0000"' \
+            '[from]="Malformed From \<malformed_from at notmuchmail.org\>"'
+output=$(notmuch search --sort=newest-first from:malformed_from at notmuchmail.org | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX   2001-01-13 [1/1] Malformed From; test subject (inbox unread)"
 
 test_begin_subtest "Broken symlink aborts"
 ln -s does-not-exist "${MAIL_DIR}/broken"
-- 
2.11.0



More information about the notmuch mailing list