Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3693D431FC3 for ; Wed, 22 Feb 2012 10:45:57 -0800 (PST) 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 OzqDHha6vWRo for ; Wed, 22 Feb 2012 10:45:55 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7757F431FB6 for ; Wed, 22 Feb 2012 10:45:55 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so311625wgb.2 for ; Wed, 22 Feb 2012 10:45:52 -0800 (PST) Received-SPF: pass (google.com: domain of pieter@praet.org designates 10.180.92.73 as permitted sender) client-ip=10.180.92.73; Authentication-Results: mr.google.com; spf=pass (google.com: domain of pieter@praet.org designates 10.180.92.73 as permitted sender) smtp.mail=pieter@praet.org Received: from mr.google.com ([10.180.92.73]) by 10.180.92.73 with SMTP id ck9mr38246230wib.2.1329936352875 (num_hops = 1); Wed, 22 Feb 2012 10:45:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.92.73 with SMTP id ck9mr31600121wib.2.1329936352742; Wed, 22 Feb 2012 10:45:52 -0800 (PST) Received: from localhost ([109.131.181.26]) by mx.google.com with ESMTPS id ga1sm74840497wib.5.2012.02.22.10.45.52 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Feb 2012 10:45:52 -0800 (PST) From: Pieter Praet To: Notmuch Mail Subject: [PATCH v2 1/7] test: emacs: new tests "notmuch-show: {show, hide} message headers" Date: Wed, 22 Feb 2012 19:43:28 +0100 Message-Id: <1329936214-30959-1-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.8.1 In-Reply-To: <1327469139-1968-1-git-send-email-pieter@praet.org> References: <1327469139-1968-1-git-send-email-pieter@praet.org> X-Gm-Message-State: ALoCoQmkzLCvLiLNWey9Nb/a9s+Oa9bVzHzYzG6L+jRvJKJhL8N27n0t0K8VzLgb5r4zaZsCJC7y 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: Wed, 22 Feb 2012 18:45:57 -0000 * test/emacs: - New subtest "notmuch-show: show message headers": Setting `notmuch-message-headers-visible' to t causes all headers defined in `notmuch-message-headers' to be shown. - New subtest "notmuch-show: hide message headers": Setting `notmuch-message-headers-visible' to nil causes all headers defined in `notmuch-message-headers' to be hidden. ("Subject:" may be an exception; See the use of `headers-start' in `notmuch-show-insert-msg') - New subtest "notmuch-show: hide message headers (w/ notmuch-show-toggle-headers)": Setting `notmuch-message-headers-visible' to t causes all headers defined in `notmuch-message-headers' to be shown, but they can be hidden for the current message by running `notmuch-show-toggle-headers'. --- test/emacs | 25 ++++++++++++++++++++ .../notmuch-show-message-with-headers-hidden | 22 +++++++++++++++++ .../notmuch-show-message-with-headers-visible | 25 ++++++++++++++++++++ 3 files changed, 72 insertions(+), 0 deletions(-) create mode 100644 test/emacs.expected-output/notmuch-show-message-with-headers-hidden create mode 100644 test/emacs.expected-output/notmuch-show-message-with-headers-visible diff --git a/test/emacs b/test/emacs index b74cfa9..f9ea1c3 100755 --- a/test/emacs +++ b/test/emacs @@ -383,6 +383,31 @@ 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 "notmuch-show: show message headers" +test_emacs \ + '(let ((notmuch-message-headers '\''("Subject" "To" "Cc" "Date")) + (notmuch-message-headers-visible t)) + (notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (test-visible-output))' +test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-message-with-headers-visible + +test_begin_subtest "notmuch-show: hide message headers" +test_emacs \ + '(let ((notmuch-message-headers '\''("Subject" "To" "Cc" "Date")) + (notmuch-message-headers-visible nil)) + (notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (test-visible-output))' +test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-message-with-headers-hidden + +test_begin_subtest "notmuch-show: hide message headers (w/ notmuch-show-toggle-headers)" +test_emacs \ + '(let ((notmuch-message-headers '\''("Subject" "To" "Cc" "Date")) + (notmuch-message-headers-visible t)) + (notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (notmuch-show-toggle-headers) + (test-visible-output))' +test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-message-with-headers-hidden + test_begin_subtest "Stashing in notmuch-show" add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \ '[from]="Some One "' \ diff --git a/test/emacs.expected-output/notmuch-show-message-with-headers-hidden b/test/emacs.expected-output/notmuch-show-message-with-headers-hidden new file mode 100644 index 0000000..9d7f91b --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-message-with-headers-hidden @@ -0,0 +1,22 @@ +Jan Janak (2009-11-17) (inbox unread) +Subject: [notmuch] What a great idea! + Jan Janak (2009-11-17) (inbox) + + On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak wrote: + > Hello, + > + > First of all, notmuch is a wonderful idea, both the cmdline tool and + [ 2 more citation lines. Click/Enter to show. ] + > + > Have you considered sending an announcement to the org-mode mailing list? + > http://org-mode.org + + Sorry, wrong URL, the correct one is: http://orgmode.org + + > Various ways of searching/referencing emails from emacs were discussed + > there several times and none of them were as elegant as notmuch (not + > even close). Maybe notmuch would attract some of the developers + > there.. + + -- Jan + Carl Worth (2009-11-18) (inbox unread) diff --git a/test/emacs.expected-output/notmuch-show-message-with-headers-visible b/test/emacs.expected-output/notmuch-show-message-with-headers-visible new file mode 100644 index 0000000..8efbd60 --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-message-with-headers-visible @@ -0,0 +1,25 @@ +Jan Janak (2009-11-17) (inbox unread) +Subject: [notmuch] What a great idea! + Jan Janak (2009-11-17) (inbox) + Subject: [notmuch] What a great idea! + To: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 23:38:47 +0100 + + On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak wrote: + > Hello, + > + > First of all, notmuch is a wonderful idea, both the cmdline tool and + [ 2 more citation lines. Click/Enter to show. ] + > + > Have you considered sending an announcement to the org-mode mailing list? + > http://org-mode.org + + Sorry, wrong URL, the correct one is: http://orgmode.org + + > Various ways of searching/referencing emails from emacs were discussed + > there several times and none of them were as elegant as notmuch (not + > even close). Maybe notmuch would attract some of the developers + > there.. + + -- Jan + Carl Worth (2009-11-18) (inbox unread) -- 1.7.8.1