]> git.notmuchmail.org Git - notmuch/blobdiff - test/T450-emacs-show.sh
emacs: add duplicate support to notmuch-show-view-raw-message
[notmuch] / test / T450-emacs-show.sh
index 9cc90d91650cf230d033d6c14c3ac90a09dcb0fa..c4202e0a3dcde3abdbe139316000de291bcf5ff9 100755 (executable)
@@ -341,7 +341,7 @@ test_expect_equal_file EXPECTED OUTPUT
 add_email_corpus duplicate
 
 ID3=87r2ecrr6x.fsf@zephyr.silentflame.com
-test_begin_subtest "duplicate=3"
+test_begin_subtest "duplicate=3, subject"
 test_emacs "(notmuch-show \"id:${ID3}\")
           (notmuch-show-choose-duplicate 3)
           (test-visible-output \"OUTPUT\")"
@@ -350,6 +350,14 @@ file=$(notmuch search --output=files id:${ID3} | head -n 3 | tail -n 1)
 subject=$(grep '^Subject:' $file)
 test_expect_equal "$output" "$subject"
 
+FILE3=$(notmuch search --output=files --duplicate=3 "id:${ID3}")
+test_begin_subtest "duplicate=3, stash"
+test_emacs_expect_t \
+       "(notmuch-show \"id:${ID3}\")
+        (notmuch-show-choose-duplicate 3)
+        (notmuch-show-stash-filename)
+        (notmuch-test-expect-equal (list (car kill-ring)) (list \"${FILE3}\"))"
+
 test_begin_subtest "duplicate=0"
 test_emacs "(test-log-error
              (notmuch-show \"id:${ID3}\")
@@ -367,4 +375,20 @@ cat <<EOF > EXPECTED
 (error Duplicate 1000 out of range [1,5])
 EOF
 test_expect_equal_file EXPECTED MESSAGES
+test_begin_subtest "duplicate=4"
+test_emacs "(notmuch-show \"id:${ID3}\")
+          (notmuch-show-choose-duplicate 4)
+          (test-visible-output \"OUTPUT\")"
+test_expect_equal_file_nonempty $EXPECTED/notmuch-show-duplicate-4 OUTPUT
+
+FILE4=$(notmuch search --output=files --duplicate=4 "id:${ID3}")
+test_begin_subtest "duplicate=4, raw"
+test_emacs "(notmuch-show \"id:${ID3}\")
+          (notmuch-show-choose-duplicate 4)
+          (notmuch-show-view-raw-message)
+          (test-visible-output \"OUTPUT\")"
+subject4=$(grep '^Subject:' $FILE4)
+subject=$(grep '^Subject:' OUTPUT)
+test_expect_equal "$subject4" "$subject"
+
 test_done