X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Femacs;h=456435c1f694d863c3c178959de5055349b528e4;hb=20adfe39d7624150a5b337bb77a9647bb3def54b;hp=5fbee1215d442bb6dc5bbd5dba8ec5bf2f3f1539;hpb=730b8f61e0cf4b2e8c0f123c0914d472d6df38fc;p=notmuch diff --git a/test/emacs b/test/emacs index 5fbee121..456435c1 100755 --- a/test/emacs +++ b/test/emacs @@ -881,15 +881,16 @@ test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) (with-current-buffer \"*Notmuch errors*\" (test-output \"ERROR\")) (test-output))" -sed -i -e 's/^\[.*\]$/[XXX]/' ERROR -test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\ + +test_expect_equal "$(notmuch_emacs_error_sanitize notmuch_fail OUTPUT MESSAGES ERROR)" "\ +=== OUTPUT === End of search results. ---- -$PWD/notmuch_fail exited with status 1 (see *Notmuch errors* for more details) ---- +=== MESSAGES === +YYY/notmuch_fail exited with status 1 (see *Notmuch errors* for more details) +=== ERROR === [XXX] -$PWD/notmuch_fail exited with status 1 -command: $PWD/notmuch_fail search --format\=sexp --format-version\=1 --sort\=newest-first tag\:inbox +YYY/notmuch_fail exited with status 1 +command: YYY/notmuch_fail search --format\=sexp --format-version\=2 --sort\=newest-first tag\:inbox exit status: 1" test_begin_subtest "Search handles subprocess warnings" @@ -922,4 +923,28 @@ This is a warning (see *Notmuch errors* for more details) This is a warning This is another warning" +test_begin_subtest "Search thread tag operations are race-free" +add_message '[subject]="Search race test"' +gen_msg_id_1=$gen_msg_id +generate_message '[in-reply-to]="<'$gen_msg_id_1'>"' \ + '[references]="<'$gen_msg_id_1'>"' \ + '[subject]="Search race test two"' +test_emacs '(notmuch-search "subject:\"search race test\"") + (notmuch-test-wait) + (notmuch-poll) + (execute-kbd-macro "+search-thread-race-tag")' +output=$(notmuch search --output=messages 'tag:search-thread-race-tag') +test_expect_equal "$output" "id:$gen_msg_id_1" + +test_begin_subtest "Search global tag operations are race-free" +generate_message '[in-reply-to]="<'$gen_msg_id_1'>"' \ + '[references]="<'$gen_msg_id_1'>"' \ + '[subject]="Re: Search race test"' +test_emacs '(notmuch-search "subject:\"search race test\" -subject:two") + (notmuch-test-wait) + (notmuch-poll) + (execute-kbd-macro "*+search-global-race-tag")' +output=$(notmuch search --output=messages 'tag:search-global-race-tag') +test_expect_equal "$output" "id:$gen_msg_id_1" + test_done