diff options
| author | David Bremner <david@tethera.net> | 2022-07-01 18:45:45 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2022-07-30 08:42:12 -0300 |
| commit | b3d466bf397a6f8d70bb50d6fa22c58e3d44badf (patch) | |
| tree | 883e233c748bd6193aecb0cd2879cfefce2eab9b /test | |
| parent | 4612f3eb3dbf16bf98ccbadef77d7a6f6361e692 (diff) | |
emacs/show: provide notmuch-show-choose-duplicate
This new command allows the user to interactively choose a different
duplicate (file) to display for a given message in
notmuch-show-mode. Since both tree and unthreaded view use
notmuch-show-mode, this provides the same facility there.
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T450-emacs-show.sh | 29 | ||||
| -rwxr-xr-x | test/T460-emacs-tree.sh | 14 | ||||
| -rwxr-xr-x | test/T465-emacs-unthreaded.sh | 15 |
3 files changed, 58 insertions, 0 deletions
diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 64f174cf..9cc90d91 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -338,4 +338,33 @@ when we detect the word "attachment" and there's no attach? :p EOF test_expect_equal_file EXPECTED OUTPUT +add_email_corpus duplicate + +ID3=87r2ecrr6x.fsf@zephyr.silentflame.com +test_begin_subtest "duplicate=3" +test_emacs "(notmuch-show \"id:${ID3}\") + (notmuch-show-choose-duplicate 3) + (test-visible-output \"OUTPUT\")" +output=$(grep "Subject:" OUTPUT) +file=$(notmuch search --output=files id:${ID3} | head -n 3 | tail -n 1) +subject=$(grep '^Subject:' $file) +test_expect_equal "$output" "$subject" + +test_begin_subtest "duplicate=0" +test_emacs "(test-log-error + (notmuch-show \"id:${ID3}\") + (notmuch-show-choose-duplicate 0))" +cat <<EOF > EXPECTED +(error Duplicate 0 out of range [1,5]) +EOF +test_expect_equal_file EXPECTED MESSAGES + +test_begin_subtest "duplicate=1000" +test_emacs "(test-log-error + (notmuch-show \"id:${ID3}\") + (notmuch-show-choose-duplicate 1000))" +cat <<EOF > EXPECTED +(error Duplicate 1000 out of range [1,5]) +EOF +test_expect_equal_file EXPECTED MESSAGES test_done diff --git a/test/T460-emacs-tree.sh b/test/T460-emacs-tree.sh index 0f23b418..bae26e3b 100755 --- a/test/T460-emacs-tree.sh +++ b/test/T460-emacs-tree.sh @@ -200,4 +200,18 @@ test_emacs '(test-log-error (notmuch-tree "*")))' test_expect_equal "$(cat MESSAGES)" "COMPLETE" +add_email_corpus duplicate + +ID3=87r2ecrr6x.fsf@zephyr.silentflame.com +test_begin_subtest "duplicate=3" +test_emacs "(notmuch-tree \"id:${ID3}\") + (notmuch-test-wait) + (notmuch-tree-show-message t) + (notmuch-show-choose-duplicate 3) + (test-visible-output \"OUTPUT\")" +output=$(grep "Subject:" OUTPUT) +file=$(notmuch search --output=files id:${ID3} | head -n 3 | tail -n 1) +subject=$(grep '^Subject:' $file) +test_expect_equal "$output" "$subject" + test_done diff --git a/test/T465-emacs-unthreaded.sh b/test/T465-emacs-unthreaded.sh index e7bc1439..9b96c7d7 100755 --- a/test/T465-emacs-unthreaded.sh +++ b/test/T465-emacs-unthreaded.sh @@ -57,4 +57,19 @@ test_emacs '(test-log-error (notmuch-unthreaded "*")))' test_expect_equal "$(cat MESSAGES)" "COMPLETE" +add_email_corpus duplicate + +ID3=87r2ecrr6x.fsf@zephyr.silentflame.com +test_begin_subtest "duplicate=3" +test_emacs "(let ((notmuch-tree-show-out t)) + (notmuch-unthreaded \"id:${ID3}\") + (notmuch-test-wait) + (notmuch-tree-show-message nil) + (notmuch-show-choose-duplicate 3) + (test-visible-output \"OUTPUT\"))" +output=$(grep "Subject:" OUTPUT) +file=$(notmuch search --output=files id:${ID3} | head -n 3 | tail -n 1) +subject=$(grep '^Subject:' $file) +test_expect_equal "$output" "$subject" + test_done |
