unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: david@tethera.net, notmuch@notmuchmail.org
Cc: David Bremner <bremner@debian.org>
Subject: Re: [Patch v4 08/10] test/dump-restore: add test for warning/error messages
Date: Sat, 08 Dec 2012 17:54:30 +0000	[thread overview]
Message-ID: <87r4n0a0q1.fsf@qmul.ac.uk> (raw)
In-Reply-To: <1354979276-20099-9-git-send-email-david@tethera.net>

On Sat, 08 Dec 2012, david@tethera.net wrote:
> From: David Bremner <bremner@debian.org>
>
> We want to test both that error/warning messages are generated when
> they should be, and not generated when they should not be. This varies
> between restore and batch tagging.
> ---
>  test/dump-restore |   29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>
> diff --git a/test/dump-restore b/test/dump-restore
> index 7d91cca..b267792 100755
> --- a/test/dump-restore
> +++ b/test/dump-restore
> @@ -181,6 +181,35 @@ notmuch restore < EXPECTED.$test_count
>  notmuch dump --format=sup > OUTPUT.$test_count
>  test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
>  
> +test_begin_subtest 'restore: checking error messages'
> +notmuch restore <<EOF 2>OUTPUT
> ++a +b
> ++c +d --
> +# this is a harmless comment, do not yell about it.
> +
> +# the previous line was blank; also no yelling please
> ++%zz -- id:whatever
> ++e +f id:%yy
> +# the next line should report an an empty tag error for batch tagging, but restore
> ++ +e -- id:20091117232137.GA7669@griffis1.net

I don't follow the comment above: do you mean "but not for restore", or
it should report an error but restore anyway or?

Best wishes

Mark

> +# highlight the sketchy id parsing; this should be last
> ++g -- id:foo and bar
> +EOF


> +
> +cat <<EOF > EXPECTED
> +Warning: no query string: +a +b
> +Warning: Ignoring invalid input line +a +b
> +Warning: no query string: +c +d --
> +Warning: Ignoring invalid input line +c +d --
> +Warning: Hex decoding of tag %zz failed
> +Warning: Ignoring invalid input line +%zz -- id:whatever
> +Warning: Hex decoding of query id:%yy failed
> +Warning: Ignoring invalid input line +e +f id:%yy
> +Warning: Cannot apply tags to missing message: foo and bar
> +EOF
> +
> +test_expect_equal_file EXPECTED OUTPUT
> +
>  test_begin_subtest 'roundtripping random message-ids and tags'
>  
>      ${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \
> -- 
> 1.7.10.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

  reply	other threads:[~2012-12-08 17:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-08 15:07 v4 of Hex Dump/Restore patches david
2012-12-08 15:07 ` [Patch v4 01/10] notmuch-dump: add --format=(batch-tag|sup) david
2012-12-08 15:07 ` [Patch v4 02/10] test: add sanity check for dump --format=batch-tag david
2012-12-08 15:07 ` [Patch v4 03/10] util: add string-util.[ch] david
2012-12-08 15:07 ` [Patch v4 04/10] tag-util.[ch]: New files for common tagging routines david
2012-12-08 19:22   ` Jani Nikula
2012-12-08 15:07 ` [Patch v4 05/10] notmuch-restore: add support for input format 'batch-tag' david
2012-12-08 15:07 ` [Patch v4 06/10] test: update dump-restore roundtripping test for batch-tag format david
2012-12-08 15:07 ` [Patch v4 07/10] test: second set of dump/restore --format=batch-tag tests david
2012-12-08 15:07 ` [Patch v4 08/10] test/dump-restore: add test for warning/error messages david
2012-12-08 17:54   ` Mark Walters [this message]
2012-12-08 18:32     ` David Bremner
2012-12-08 15:07 ` [Patch v4 09/10] notmuch-{dump, restore}.1: document new format options david
2012-12-08 15:07 ` [Patch v4 10/10] tag-util: optimization of tag application david
2012-12-08 19:35 ` v4 of Hex Dump/Restore patches Jani Nikula
2012-12-08 19:47 ` Mark Walters

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=87r4n0a0q1.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=bremner@debian.org \
    --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).