unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] test: Search for non-existent message should return nothing
@ 2010-11-01 16:15 Michal Sojka
  2010-11-01 16:15 ` [PATCH 2/2] Print nothing when search result is empty Michal Sojka
  2010-11-04 19:39 ` [PATCH 1/2] test: Search for non-existent message should return nothing Carl Worth
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Sojka @ 2010-11-01 16:15 UTC (permalink / raw)
  To: notmuch

My scripts expect that empty search result is actually empty. Since
commit 6dcb7592, even empty search prints a newline character and this
breaks my scripts.

This patch adds a test for this bug. In the test I cannot use
test_expect_equal function as $() operator suppresses the final
newline and this kind of difference is not detected.

 test/search |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
 test/search |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/test/search b/test/search
index 9132555..5939c6a 100755
--- a/test/search
+++ b/test/search
@@ -96,4 +96,9 @@ add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12
 output=$(notmuch search "bödý" | notmuch_search_sanitize)
 test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; utf8-message-body-subject (inbox unread)"
 
+test_expect_success "Search for non-existent message prints nothing" '
+echo -n > expected &&
+notmuch search "no-message-matches-this" > actual &&
+test_cmp expected actual'
+
 test_done
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-04 19:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-01 16:15 [PATCH 1/2] test: Search for non-existent message should return nothing Michal Sojka
2010-11-01 16:15 ` [PATCH 2/2] Print nothing when search result is empty Michal Sojka
2010-11-04 19:39 ` [PATCH 1/2] test: Search for non-existent message should return nothing Carl Worth

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).