unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/2] test: improve insert test reliability by checking message-id instead of count
Date: Tue,  3 Sep 2013 08:19:03 +0300	[thread overview]
Message-ID: <1378185543-25271-2-git-send-email-jani@nikula.org> (raw)
In-Reply-To: <1378185543-25271-1-git-send-email-jani@nikula.org>

There isn't a reported issue this would fix. Spotted by reading the
test.
---
 test/insert | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/insert b/test/insert
index 9b448e5..550b413 100755
--- a/test/insert
+++ b/test/insert
@@ -68,14 +68,14 @@ test_expect_equal_json "$output" '["inbox", "unread"]'
 test_begin_subtest "Insert message, add tag"
 gen_insert_msg
 notmuch insert +custom < "$gen_msg_filename"
-output=$(notmuch count tag:custom)
-test_expect_equal "$output" "1"
+output=$(notmuch search --output=messages tag:custom)
+test_expect_equal "$output" "id:$gen_msg_id"
 
 test_begin_subtest "Insert message, add/remove tags"
 gen_insert_msg
 notmuch insert +custom -unread < "$gen_msg_filename"
-output=$(notmuch count tag:custom NOT tag:unread)
-test_expect_equal "$output" "1"
+output=$(notmuch search --output=messages tag:custom NOT tag:unread)
+test_expect_equal "$output" "id:$gen_msg_id"
 
 test_begin_subtest "Insert message with default tags stays in new/"
 gen_insert_msg
@@ -123,8 +123,8 @@ test_expect_equal "$dirname" "$MAIL_DIR/Drafts/new"
 test_begin_subtest "Insert message into folder, add/remove tags"
 gen_insert_msg
 notmuch insert --folder=Drafts +draft -unread < "$gen_msg_filename"
-output=$(notmuch count folder:Drafts tag:draft NOT tag:unread)
-test_expect_equal "$output" "1"
+output=$(notmuch search --output=messages folder:Drafts tag:draft NOT tag:unread)
+test_expect_equal "$output" "id:$gen_msg_id"
 
 gen_insert_msg
 test_expect_code 1 "Insert message into non-existent folder" \
-- 
1.8.4.rc3

  reply	other threads:[~2013-09-03  5:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 21:32 [PATCH 0/3] Adding non-maildir tags does not move message from new to cur Michal Sojka
2012-12-19 21:32 ` [PATCH 1/3] test: " Michal Sojka
2013-09-03 23:56   ` David Bremner
2012-12-19 21:32 ` [PATCH 2/3] test: Add some missing maildir synchronization tests Michal Sojka
2012-12-19 21:32 ` [PATCH 3/3] tags_to_maildir_flags: Don't rename if no flags change Michal Sojka
2013-09-03  1:10   ` [PATCH] test: update insert tests for new maildir synchronization rules david
2013-09-03  5:19     ` [PATCH 1/2] test: add more maildir flag syncing related tests to insert Jani Nikula
2013-09-03  5:19       ` Jani Nikula [this message]
2013-09-03  9:26       ` David Bremner
2013-09-03 12:11         ` Jani Nikula
2013-09-03  5:22     ` [PATCH] test: update insert tests for new maildir synchronization rules Jani Nikula
2013-09-02 17:56 ` [PATCH 0/3] Adding non-maildir tags does not move message from new to cur Jani Nikula

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=1378185543-25271-2-git-send-email-jani@nikula.org \
    --to=jani@nikula.org \
    --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).