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 76160429E40 for ; Sat, 21 Jan 2012 16:55:10 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.8 X-Spam-Level: X-Spam-Status: No, score=-0.8 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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 s9rvRKkQjbep for ; Sat, 21 Jan 2012 16:55:09 -0800 (PST) Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 61117429E54 for ; Sat, 21 Jan 2012 16:55:09 -0800 (PST) Received: by eaal1 with SMTP id l1so936427eaa.26 for ; Sat, 21 Jan 2012 16:55:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schoepe.org; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=vO1vvZCZqlnIUaiNh49hwEzZkvu2mPRzFT9QYmtm4S0=; b=Hri8QsdlhBjzFo6zD4BpugMX+K4ceGbjwwpTQBvferZIiy0lvPZ3X/WOmTfZgov6F5 H2eb1k3ZlJAlg+CboG1xF3pmv9j7wJxrcTAyoY6uYAjGkW3zPit7qEGy8qJhvzVmoy9X bDawx4gRhaTfZpiiSWhpYt0FJfLAWLmEMyw+M= Received: by 10.213.8.199 with SMTP id i7mr645108ebi.129.1327193708117; Sat, 21 Jan 2012 16:55:08 -0800 (PST) Received: from localhost (dslb-188-107-198-094.pools.arcor-ip.net. [188.107.198.94]) by mx.google.com with ESMTPS id s16sm32828236eef.2.2012.01.21.16.55.06 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Jan 2012 16:55:07 -0800 (PST) From: Daniel Schoepe To: notmuch@notmuchmail.org Subject: [PATCH v7 2/2] emacs: Tests for user-defined sections Date: Sun, 22 Jan 2012 01:54:49 +0100 Message-Id: <1327193689-6011-2-git-send-email-daniel@schoepe.org> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1327193689-6011-1-git-send-email-daniel@schoepe.org> References: <87d3ac8ta9.fsf@schoepe.localhost> <1327193689-6011-1-git-send-email-daniel@schoepe.org> Cc: Daniel Schoepe 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: Sun, 22 Jan 2012 00:55:10 -0000 From: Daniel Schoepe --- test/emacs | 37 ++++++++++++++++++++ test/emacs.expected-output/notmuch-hello | 4 ++- .../notmuch-hello-new-section | 4 ++ .../notmuch-hello-no-saved-searches | 4 ++- .../notmuch-hello-section-counts | 5 +++ .../notmuch-hello-section-hidden-tag | 4 ++ .../notmuch-hello-section-with-empty | 4 ++ .../emacs.expected-output/notmuch-hello-with-empty | 4 ++- 8 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 test/emacs.expected-output/notmuch-hello-new-section create mode 100644 test/emacs.expected-output/notmuch-hello-section-counts create mode 100644 test/emacs.expected-output/notmuch-hello-section-hidden-tag create mode 100644 test/emacs.expected-output/notmuch-hello-section-with-empty diff --git a/test/emacs b/test/emacs index ac47b16..8b1d16c 100755 --- a/test/emacs +++ b/test/emacs @@ -29,6 +29,43 @@ test_emacs '(let ((notmuch-saved-searches (test-output))' test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches +test_begin_subtest "User defined section with inbox tag" +test_emacs "(let ((notmuch-hello-sections + (list (lambda () (notmuch-hello-insert-searches + \"Test\" '((\"inbox\" . \"tag:inbox\"))))))) + (notmuch-hello) + (test-output))" +test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-new-section + +test_begin_subtest "User defined section with empty, hidden entry" +test_emacs "(let ((notmuch-hello-sections + (list (lambda () (notmuch-hello-insert-searches + \"Test-with-empty\" + '((\"inbox\" . \"tag:inbox\") + (\"doesnotexist\" . \"tag:doesnotexist\")) + :hide-empty-searches t))))) + (notmuch-hello) + (test-output))" +test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-with-empty + +test_begin_subtest "User defined section, unread tag filtered out" +test_emacs "(let ((notmuch-hello-sections + (list (lambda () (notmuch-hello-insert-tags-section + \"Test-with-filtered\" + :hide-tags '(\"unread\")))))) + (notmuch-hello) + (test-output))" +test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-hidden-tag + +test_begin_subtest "User defined section, different query for counts" +test_emacs "(let ((notmuch-hello-sections + (list (lambda () (notmuch-hello-insert-tags-section + \"Test-with-counts\" + :filter-count \"tag:signed\"))))) + (notmuch-hello) + (test-output))" +test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts + test_begin_subtest "Basic notmuch-search view in emacs" test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello index 196112e..cf49cb4 100644 --- a/test/emacs.expected-output/notmuch-hello +++ b/test/emacs.expected-output/notmuch-hello @@ -6,9 +6,11 @@ Saved searches: [edit] Search: . -[Show all tags] +All tags: [show] Type a search query and hit RET to view matching threads. Edit saved searches with the `edit' button. Hit RET or click on a saved search or tag name to view matching threads. `=' refreshes this screen. `s' jumps to the search box. `q' to quit. + Customize this page. + diff --git a/test/emacs.expected-output/notmuch-hello-new-section b/test/emacs.expected-output/notmuch-hello-new-section new file mode 100644 index 0000000..c64d712 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-new-section @@ -0,0 +1,4 @@ +Test: [hide] + + 52 inbox + diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches index f4cfe49..cec0f91 100644 --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches @@ -2,9 +2,11 @@ Search: . -[Show all tags] +All tags: [show] Type a search query and hit RET to view matching threads. Edit saved searches with the `edit' button. Hit RET or click on a saved search or tag name to view matching threads. `=' refreshes this screen. `s' jumps to the search box. `q' to quit. + Customize this page. + diff --git a/test/emacs.expected-output/notmuch-hello-section-counts b/test/emacs.expected-output/notmuch-hello-section-counts new file mode 100644 index 0000000..9d79659 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-section-counts @@ -0,0 +1,5 @@ +Test-with-counts: [hide] + + 2 attachment 7 signed + 7 inbox 7 unread + diff --git a/test/emacs.expected-output/notmuch-hello-section-hidden-tag b/test/emacs.expected-output/notmuch-hello-section-hidden-tag new file mode 100644 index 0000000..3688e7c --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-section-hidden-tag @@ -0,0 +1,4 @@ +Test-with-filtered: [hide] + + 4 attachment 52 inbox 7 signed + diff --git a/test/emacs.expected-output/notmuch-hello-section-with-empty b/test/emacs.expected-output/notmuch-hello-section-with-empty new file mode 100644 index 0000000..8209fed --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-section-with-empty @@ -0,0 +1,4 @@ +Test-with-empty: [hide] + + 52 inbox + diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty index a860a72..76ab2e1 100644 --- a/test/emacs.expected-output/notmuch-hello-with-empty +++ b/test/emacs.expected-output/notmuch-hello-with-empty @@ -6,9 +6,11 @@ Saved searches: [edit] Search: . -[Show all tags] +All tags: [show] Type a search query and hit RET to view matching threads. Edit saved searches with the `edit' button. Hit RET or click on a saved search or tag name to view matching threads. `=' refreshes this screen. `s' jumps to the search box. `q' to quit. + Customize this page. + -- 1.7.8.3