unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Pieter Praet <pieter@praet.org>
To: notmuch@notmuchmail.org
Subject: [PATCH] test: stashing in notmuch-{show,search}
Date: Thu, 30 Jun 2011 10:23:23 +0200	[thread overview]
Message-ID: <1309422203-24685-1-git-send-email-pieter@praet.org> (raw)
In-Reply-To: <1309422050-23241-1-git-send-email-pieter@praet.org>

Should provide full test coverage of the stashing feature.

Signed-off-by: Pieter Praet <pieter@praet.org>
---
 test/emacs                                |   41 +++++++++++++++++++++++++++++
 test/emacs.expected-output/emacs-stashing |    9 ++++++
 2 files changed, 50 insertions(+), 0 deletions(-)
 create mode 100644 test/emacs.expected-output/emacs-stashing

diff --git a/test/emacs b/test/emacs
index 53f455a..46076c6 100755
--- a/test/emacs
+++ b/test/emacs
@@ -347,4 +347,45 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.
 	    (test-visible-output)'
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
 
+test_begin_subtest "Stashing in notmuch-show"
+add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \
+    '[from]="Some One <someone@somewhere.org>"' \
+    '[to]="Some One Else <notsomeone@somewhere.org>"' \
+    '[cc]="Notmuch <notmuch@notmuchmail.org>"' \
+    '[subject]="Stash my stashables"' \
+    '[id]="bought"' \
+    '[body]="Unable to stash body. Where did you get it in the first place?!?"'
+notmuch tag +stashtest id:${gen_msg_id}
+test_emacs '(notmuch-show "id:\"bought\"")
+        (notmuch-show-stash-date)
+        (notmuch-show-stash-from)
+        (notmuch-show-stash-to)
+        (notmuch-show-stash-cc)
+        (notmuch-show-stash-subject)
+        (notmuch-show-stash-message-id)
+        (notmuch-show-stash-message-id-stripped)
+        (notmuch-show-stash-tags)
+        (notmuch-show-stash-filename)
+        (switch-to-buffer
+          (generate-new-buffer "*test-stashing*"))
+        (dotimes (i 9)
+          (yank)
+          (insert "\n")
+          (rotate-yank-pointer 1))
+        (reverse-region (point-min) (point-max))
+	    (test-output)'
+sed -i -e 's/^.*tmp.emacs\/mail.*$/FILENAME/' OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/emacs-stashing
+
+test_begin_subtest "Stashing in notmuch-search"
+test_emacs '(notmuch-search "id:\"bought\"")
+        (notmuch-test-wait)
+        (notmuch-search-stash-thread-id)
+        (switch-to-buffer
+          (generate-new-buffer "*test-stashing*"))
+        (yank)
+	    (test-output)'
+sed -i -e 's/^thread:.*$/thread:XXX/' OUTPUT
+test_expect_equal $(cat OUTPUT) "thread:XXX"
+
 test_done
diff --git a/test/emacs.expected-output/emacs-stashing b/test/emacs.expected-output/emacs-stashing
new file mode 100644
index 0000000..4923594
--- /dev/null
+++ b/test/emacs.expected-output/emacs-stashing
@@ -0,0 +1,9 @@
+Sat, 01 Jan 2000 12:00:00 -0000
+Some One <someone@somewhere.org>
+Some One Else <notsomeone@somewhere.org>
+Notmuch <notmuch@notmuchmail.org>
+Stash my stashables
+id:"bought"
+bought
+inbox,stashtest
+FILENAME
-- 
1.7.4.1

  reply	other threads:[~2011-06-30  8:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24  2:09 Inconsistent output from "notmuch search --output=<foo>" Carl Worth
2010-11-24  3:30 ` Jameson Rollins
2010-11-24  8:38 ` Sebastian Spaeth
2010-11-24 10:36   ` David Edmondson
2010-11-24 19:40   ` Carl Worth
2010-11-25 15:41     ` Jameson Rollins
2010-11-24  9:25 ` Michal Sojka
2011-03-29  0:39 ` Sebastian Spaeth
2011-06-30  8:19   ` [PATCH] remove prefixes from `--output={threads,messages}' results Pieter Praet
2011-06-30 16:24     ` [PATCH] remove prefixes from `--output={threads, messages}' results Carl Worth
2011-06-30 17:54       ` Pieter Praet
2011-06-30  8:20   ` [PATCH] add `tag:' prefix to `--output=tags' results Pieter Praet
2011-06-30  8:35     ` [PATCH] fix breakage in `notmuch-hello-generate-tag-alist' due to `tag:' prefix Pieter Praet
2011-06-30  8:36     ` [PATCH] fix breakage in `notmuch-select-tag-with-completion' " Pieter Praet
2011-11-12 15:17     ` [PATCH] add `tag:' prefix to `--output=tags' results David Bremner
2011-11-13 14:14       ` Jani Nikula
2011-11-16 11:07         ` Pieter Praet
2011-11-13 23:00       ` Jameson Graef Rollins
2011-11-14  6:56         ` Dmitry Kurochkin
2011-11-16 11:28         ` Pieter Praet
2012-01-16 10:56     ` David Edmondson
2012-01-16 10:58       ` Pieter Praet
2011-06-30  8:20   ` [PATCH] emacs: add keybind and function to stash Message-ID without prefix Pieter Praet
2011-06-30  8:23     ` Pieter Praet [this message]
2011-11-13  1:12       ` [PATCH] test: stashing in notmuch-{show,search} David Bremner
2011-11-16 11:38         ` [PATCH] test: emacs: tidy up "Stashing in notmuch-show" test Pieter Praet
2011-11-18 19:26           ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309422203-24685-1-git-send-email-pieter@praet.org \
    --to=pieter@praet.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).