add_email_corpus
+# syntax errors in test-lib.el cause mysterious failures
+test_expect_success 'Syntax of emacs test library' \
+ "${TEST_EMACS} -Q --batch --load $TEST_DIRECTORY/test-lib.el"
+
test_begin_subtest "Basic notmuch-hello view in emacs"
test_emacs '(notmuch-hello)
(test-output)'
${gen_msg_filename}
http://mid.gmane.org/bought
http://marc.info/?i=bought
-http://mail-archive.com/search?l=mid&q=bought
+http://mid.mail-archive.com/bought
EOF
test_expect_equal_file OUTPUT EXPECTED
output=$(notmuch search --output=messages 'tag:search-global-race-tag')
test_expect_equal "$output" "id:$gen_msg_id_1"
+test_begin_subtest "Term escaping"
+output=$(test_emacs "(mapcar 'notmuch-escape-boolean-term (list
+ \"\"
+ \"abc\`~\!@#\$%^&*-=_+123\"
+ \"(abc\"
+ \")abc\"
+ \"\\\"abc\"
+ \"\x01xyz\"
+ \"\\x201cxyz\\x201d\"))")
+test_expect_equal "$output" '("\"\"" "abc`~!@#$%^&*-=_+123" "\"(abc\"" "\")abc\"" "\"\"\"abc\"" "\"'$'\x01''xyz\"" "\"“xyz”\"")'
+
test_done