unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Cc: David Bremner <david@tethera.net>
Subject: Re: [PATCH] test: fix syntax errors in erroring calls to notmuch insert
Date: Fri, 04 Sep 2020 08:34:27 +0300	[thread overview]
Message-ID: <m2eenixfz0.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20200904011057.3567667-1-david@tethera.net>

On Thu, Sep 03 2020, David Bremner wrote:

> notmuch insert does not currently support passing a filename for the
> input, so all of these tests have an extra error in addition to the
> one being tested for.
>
> Currently this does not make a difference because the error being
> tested for is caught before the error of an extra command line
> argument. In the future it might make a difference, and in any case it
> is confusing.

LGTM.

Tomi

> ---
>  test/T070-insert.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/test/T070-insert.sh b/test/T070-insert.sh
> index c8161e1e..1c7ca846 100755
> --- a/test/T070-insert.sh
> +++ b/test/T070-insert.sh
> @@ -222,24 +222,24 @@ test_expect_equal "$output" "2"
>  
>  test_begin_subtest "Insert message, create invalid subfolder"
>  gen_insert_msg
> -test_expect_code 1 "notmuch insert --folder=../G --create-folder $gen_msg_filename"
> +test_expect_code 1 "notmuch insert --folder=../G --create-folder < $gen_msg_filename"
>  
>  OLDCONFIG=$(notmuch config get new.tags)
>  
>  test_begin_subtest "Empty tags in new.tags are forbidden"
>  notmuch config set new.tags "foo;;bar"
>  gen_insert_msg
> -output=$(notmuch insert $gen_msg_filename 2>&1)
> +output=$(notmuch insert < $gen_msg_filename 2>&1)
>  test_expect_equal "$output" "Error: tag '' in new.tags: empty tag forbidden"
>  
>  test_begin_subtest "Tags starting with '-' in new.tags are forbidden"
>  notmuch config set new.tags "-foo;bar"
>  gen_insert_msg
> -output=$(notmuch insert $gen_msg_filename 2>&1)
> +output=$(notmuch insert < $gen_msg_filename 2>&1)
>  test_expect_equal "$output" "Error: tag '-foo' in new.tags: tag starting with '-' forbidden"
>  
>  test_begin_subtest "Invalid tags set exit code"
> -test_expect_code 1 "notmuch insert $gen_msg_filename 2>&1"
> +test_expect_code 1 "notmuch insert < $gen_msg_filename 2>&1"
>  
>  notmuch config set new.tags $OLDCONFIG
>  
> -- 
> 2.28.0

  reply	other threads:[~2020-09-04  5:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  1:10 [PATCH] test: fix syntax errors in erroring calls to notmuch insert David Bremner
2020-09-04  5:34 ` Tomi Ollila [this message]
2020-09-05  0:05 ` David Bremner

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=m2eenixfz0.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=david@tethera.net \
    --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).