From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id BAF3E41ED86 for ; Thu, 30 Jun 2011 01:23:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nnmOuPYVYUc0 for ; Thu, 30 Jun 2011 01:23:32 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B225C42119B for ; Thu, 30 Jun 2011 01:23:31 -0700 (PDT) Received: by wyh22 with SMTP id 22so1530868wyh.26 for ; Thu, 30 Jun 2011 01:23:30 -0700 (PDT) Received: by 10.216.58.135 with SMTP id q7mr1556745wec.48.1309422210223; Thu, 30 Jun 2011 01:23:30 -0700 (PDT) Received: from localhost ([109.131.21.173]) by mx.google.com with ESMTPS id g2sm996338wes.34.2011.06.30.01.23.28 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Jun 2011 01:23:29 -0700 (PDT) From: Pieter Praet To: notmuch@notmuchmail.org Subject: [PATCH] test: stashing in notmuch-{show,search} Date: Thu, 30 Jun 2011 10:23:23 +0200 Message-Id: <1309422203-24685-1-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1309422050-23241-1-git-send-email-pieter@praet.org> References: <1309422050-23241-1-git-send-email-pieter@praet.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2011 08:23:32 -0000 Should provide full test coverage of the stashing feature. Signed-off-by: Pieter Praet --- 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 "' \ + '[to]="Some One Else "' \ + '[cc]="Notmuch "' \ + '[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 +Some One Else +Notmuch +Stash my stashables +id:"bought" +bought +inbox,stashtest +FILENAME -- 1.7.4.1