unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: Damien Cassou <damien.cassou@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH 4/4] emacs: Add unit-tests for clickable tags
Date: Thu, 13 Dec 2012 17:27:37 +0000	[thread overview]
Message-ID: <87k3sllv5i.fsf@qmul.ac.uk> (raw)
In-Reply-To: <1355404167-31750-5-git-send-email-damien.cassou@gmail.com>


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 <damien.cassou@gmail.com> wrote:
> Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
> ---
>  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

  reply	other threads:[~2012-12-13 17:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13 13:09 [PATCH v5] emacs: display tags in notmuch-show with links Damien Cassou
2012-12-13 13:09 ` [PATCH 1/4] emacs: Add a thread's tags to notmuch-show header-line Damien Cassou
2012-12-13 13:09 ` [PATCH 2/4] emacs: Make tags in notmuch-show header-line clickable Damien Cassou
2012-12-13 13:09 ` [PATCH 3/4] emacs: Make all tags in `notmuch-show' clickable Damien Cassou
2012-12-13 13:09 ` [PATCH 4/4] emacs: Add unit-tests for clickable tags Damien Cassou
2012-12-13 17:27   ` Mark Walters [this message]
2012-12-14 12:27     ` Damien Cassou
2012-12-13 16:37 ` [PATCH v5] emacs: display tags in notmuch-show with links Mark Walters
  -- strict thread matches above, loose matches on Subject: below --
2012-12-11  9:00 Damien Cassou
2012-12-11  9:00 ` [PATCH 4/4] emacs: Add unit-tests for clickable tags Damien Cassou
2012-12-10 14:32 [PATCH v3] emacs: display tags in notmuch-show with links Damien Cassou
2012-12-10 14:32 ` [PATCH 4/4] emacs: Add unit-tests for clickable tags Damien Cassou

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=87k3sllv5i.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=damien.cassou@gmail.com \
    --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).