[PATCH v2 4/4] test: emacs: new test "notmuch-search: change tags of all matching messages"

Tomi Ollila tomi.ollila at iki.fi
Sun Feb 19 13:08:30 PST 2012


On Sun, 19 Feb 2012 21:38:28 +0100, Pieter Praet <pieter at praet.org> wrote:
> `notmuch-search-tag-all' (bound to "*") adds and removes tags
> to/from all messages which match the query used to populate the
> current search buffer.
> ---
>  test/emacs |   32 ++++++++++++++++++++++++++++++++
>  1 files changed, 32 insertions(+), 0 deletions(-)
> 

[ ... ]

> +old_tag_count_1=$(notmuch count tag:"${old_tag}" "${filter}")
> +new_tag_count_1=$(notmuch count tag:"${new_tag}" "${filter}")
> +test "${old_tag_count_1}" == "0" && old_tag_count_1="Need 1+ matches!"
> +test "${new_tag_count_1}" == "0" || new_tag_count_1="Need 0 matches!"
> +# Change tags of all matching messages and get tag counts
> +test_emacs "(notmuch-search \"tag:${old_tag} ${filter}\")

Small nit: string equality comparison operator is '='. 
Use  grep '==' test/*  to confirm (or man test).

[ ... ]

Tomi


More information about the notmuch mailing list