Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 9A0C440D171 for ; Mon, 1 Nov 2010 09:16:37 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u+RjlEmVV4Yv for ; Mon, 1 Nov 2010 09:16:25 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 96D014196F0 for ; Mon, 1 Nov 2010 09:16:25 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 7E1C419F3326; Mon, 1 Nov 2010 17:16:24 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id xbKDABMvbnpS; Mon, 1 Nov 2010 17:16:23 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id F1CC719F32EE; Mon, 1 Nov 2010 17:16:22 +0100 (CET) Received: from steelpick.2x.cz (pc-dolezilkova.felk.cvut.cz [147.32.86.26]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id E789B15C027; Mon, 1 Nov 2010 17:16:22 +0100 (CET) Received: from wsh by steelpick.2x.cz with local (Exim 4.72) (envelope-from ) id 1PCx3V-000414-OA; Mon, 01 Nov 2010 17:16:21 +0100 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH 1/2] test: Search for non-existent message should return nothing Date: Mon, 1 Nov 2010 17:15:39 +0100 Message-Id: <1288628140-15410-1-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 1.7.2.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 16:16:37 -0000 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