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 D7757431FB6 for ; Thu, 13 Dec 2012 09:27:40 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 YC90gbj7nUUY for ; Thu, 13 Dec 2012 09:27:39 -0800 (PST) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 91463431FBC for ; Thu, 13 Dec 2012 09:27:38 -0800 (PST) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1TjCZM-0002jE-PM; Thu, 13 Dec 2012 17:27:37 +0000 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1TjCZM-0001yT-AQ; Thu, 13 Dec 2012 17:27:36 +0000 From: Mark Walters To: Damien Cassou , notmuch@notmuchmail.org Subject: Re: [PATCH 4/4] emacs: Add unit-tests for clickable tags In-Reply-To: <1355404167-31750-5-git-send-email-damien.cassou@gmail.com> References: <1355404167-31750-1-git-send-email-damien.cassou@gmail.com> <1355404167-31750-5-git-send-email-damien.cassou@gmail.com> User-Agent: Notmuch/0.14+155~g7edfdc3 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Thu, 13 Dec 2012 17:27:37 +0000 Message-ID: <87k3sllv5i.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 91e54d01937d04feba19b72dad0814d7 (of first 20000 bytes) X-SpamAssassin-Score: -1.8 X-SpamAssassin-SpamBar: - X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -1.8 points. Summary of the scoring: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [138.37.6.40 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * 0.5 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean 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, 13 Dec 2012 17:27:41 -0000 Hi I thought I had checked the test output but I am getting a failure: the last test in emacs-show is failing (test_begin_subtest "id buttonization") I think it is just saying your patch is working and making the tag inbox in the message line a button. Best wishes Mark On Thu, 13 Dec 2012, Damien Cassou wrote: > Signed-off-by: Damien Cassou > --- > test/emacs | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 103 insertions(+) > > diff --git a/test/emacs b/test/emacs > index 5403930..af9d37c 100755 > --- a/test/emacs > +++ b/test/emacs > @@ -852,5 +852,108 @@ test_emacs "(let ((mm-text-html-renderer > test_expect_success "Rendering HTML mail with images" \ > 'cat OUTPUT && grep -q smiley OUTPUT' > > +test_begin_subtest "Extracting all tags from a thread" > +add_message \ > + '[subject]="Extracting all tags from a thread"' \ > + '[body]="body 1"' > +parent=${gen_msg_id} > +add_message \ > + '[subject]="Extracting all tags from a thread"' \ > + '[body]="body 2"' \ > + "[in-reply-to]=\<$parent\>" > +add_message \ > + '[subject]="Extracting all tags from a thread"' \ > + '[body]="body 3"' \ > + "[in-reply-to]=\<$parent\>" > +latest=${gen_msg_id} > +# Extract the thread-id from one of the emails > +thread_id=$(notmuch search --output=threads id:${latest}) > +echo THREAD ID: '"'$thread_id'"' > +# Add tag "mytagfoo" to one of the emails > +notmuch tag +mytagfoo id:${latest} > +test_emacs_expect_t \ > + "(notmuch-show \"${thread_id}\") > + (let ((output (notmuch-show-thread-tags)) > + (expected '(\"inbox\" \"mytagfoo\" \"unread\"))) > + (notmuch-test-expect-equal > + (sort output #'string<) > + (sort expected #'string<)))" > + > +test_begin_subtest "The tags appear in the header-line of notmuch-show" > +add_message \ > + '[subject]="foo bar"' \ > + '[body]="body 1"' > +latest=${gen_msg_id} > +# Add tag "mytagfoo" to one of the emails > +notmuch tag +mytagfoo id:${latest} > +# Extract the thread-id from one of the emails > +thread_id=$(notmuch search --output=threads id:${latest}) > +test_emacs_expect_t \ > + "(notmuch-show \"${thread_id}\") > + (if (string-match-p \"mytagfoo\" (format-mode-line header-line-format)) > + t > + \"The tag 'mytagfoo' was not in the header-line-format\")" > + > +test_begin_subtest "The tags appear in the header-line of notmuch-show even after update" > +add_message \ > + '[subject]="foo bar"' \ > + '[body]="body 1"' > +latest=${gen_msg_id} > +# Extract the thread-id from one of the emails > +thread_id=$(notmuch search --output=threads id:${latest}) > +test_emacs_expect_t \ > + "(notmuch-show \"${thread_id}\") > + (if (string-match-p \"mytagfoo\" (format-mode-line header-line-format)) > + (error \"There is no reason for 'mytagfoo' to be there.\")) > + (notmuch-show-tag \"+mytagfoo\") > + (if (string-match-p \"mytagfoo\" (format-mode-line header-line-format)) > + t > + \"The tag 'mytagfoo' was not in the header-line-format\")" > + > +test_begin_subtest "The tags of notmuch-show emails are clickable" > +add_message \ > + '[subject]="foo bar"' \ > + '[body]="body 1"' > +latest=${gen_msg_id} > +# Add tag "mytagfoo" to one of the emails > +notmuch tag +mytagfoo id:${latest} > +# Extract the thread-id from one of the emails > +thread_id=$(notmuch search --output=threads id:${latest}) > +test_emacs_expect_t \ > + "(notmuch-show \"${thread_id}\") > + (goto-char (point-min)) > + (re-search-forward \"mytagfoo\") > + (backward-char) ;; to be 'in' the tag > + (unless (eq major-mode 'notmuch-show-mode) > + (error \"We must be in notmuch-show at this point but we are in %s.\" major-mode)) > + (push-button) ;; simulate a press on the RET key > + (if (eq major-mode 'notmuch-search-mode) > + t > + (format \"We must be in notmuch-search at this point but we are in %s.\" major-mode))" > + > +test_begin_subtest "The tags of notmuch-show emails are clickable even after update" > +add_message \ > + '[subject]="foo bar"' \ > + '[body]="body 1"' > +latest=${gen_msg_id} > +# Extract the thread-id from one of the emails > +thread_id=$(notmuch search --output=threads id:${latest}) > +test_emacs_expect_t \ > + "(notmuch-show \"${thread_id}\") > + (goto-char (point-min)) > + (if (re-search-forward \"mytagfoo\" nil t) > + (error \"There is no reason for 'mytagfoo' to be there.\")) > + (notmuch-show-tag \"+mytagfoo\") > + (goto-char (point-min)) > + (unless (re-search-forward \"mytagfoo\" nil t) > + (error \"The tag 'mytagfoo' must have been there.\")) > + (backward-char) ;; to be 'in' the tag > + (unless (eq major-mode 'notmuch-show-mode) > + (error \"We must be in notmuch-show at this point but we are in %s.\" major-mode)) > + (push-button) ;; simulate a press on the RET key > + (if (eq major-mode 'notmuch-search-mode) > + t > + (format \"We must be in notmuch-search at this point but we are in %s.\" major-mode))" > + > > test_done > -- > 1.7.10.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch