3 test_description="emacs unthreaded interface"
4 . $(dirname "$0")/test-lib.sh || exit 1
5 . $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1
9 EXPECTED=$NOTMUCH_SRCDIR/test/emacs-unthreaded.expected-output
11 generate_message "[id]=large-thread-1" '[subject]="large thread"'
12 printf " 2001-01-05 Notmuch Test Suite large thread%43s(inbox unread)\n" >> EXPECTED.unthreaded
14 for num in $(seq 2 64); do
16 generate_message '[subject]="large thread"' "[id]=large-thread-$num" "[in-reply-to]=\<large-thread-$prev\>"
17 printf " 2001-01-05 Notmuch Test Suite large thread%43s(inbox unread)\n" >> EXPECTED.unthreaded
19 printf "End of search results.\n" >> EXPECTED.unthreaded
21 notmuch new > new.output 2>&1
23 test_begin_subtest "large thread"
24 test_emacs '(let ((max-lisp-eval-depth 10))
25 (notmuch-unthreaded "subject:large-thread")
28 test_expect_equal_file EXPECTED.unthreaded OUTPUT
30 test_begin_subtest "message from large thread (status)"
31 output=$(test_emacs '(let ((max-lisp-eval-depth 10))
32 (notmuch-unthreaded "subject:large-thread")
34 (notmuch-tree-show-message nil)
37 test_expect_equal "$output" '"SUCCESS"'
40 test_begin_subtest "Functions in unthreaded-result-format"
43 ((notmuch-unthreaded-result-format
44 (quote (("date" . "%12s ")
47 (notmuch-test-result-flags . "(%s)")))))
48 (notmuch-unthreaded "tag:inbox")
52 test_expect_equal_file $EXPECTED/result-format-function OUTPUT
54 test_begin_subtest "notmuch-unthreaded with nonexistent CWD"
55 test_emacs '(test-log-error
56 (let ((default-directory "/nonexistent"))
57 (notmuch-unthreaded "*")))'
58 test_expect_equal "$(cat MESSAGES)" "COMPLETE"