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 A857E431FB6 for ; Sat, 28 May 2011 14:52:12 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.921 X-Spam-Level: X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled 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 5lHPPuTzU7Ss for ; Sat, 28 May 2011 14:52:12 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id A0D50429E25 for ; Sat, 28 May 2011 14:52:11 -0700 (PDT) Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1]) by earth-doxen-postvirus (Postfix) with ESMTP id 136D666E00B9; Sat, 28 May 2011 14:52:10 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com [98.149.172.122]) (Authenticated sender: jrollins) by earth-doxen-submit (Postfix) with ESMTP id 8C5B566E022C; Sat, 28 May 2011 14:52:04 -0700 (PDT) Received: by servo.finestructure.net (Postfix, from userid 1000) id 2239B780; Sat, 28 May 2011 14:52:05 -0700 (PDT) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH 04/25] test: move "Search for non-existent message prints nothing" to search-output, and add similar test for format=json Date: Sat, 28 May 2011 14:51:39 -0700 Message-Id: <1306619520-25730-5-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306619520-25730-4-git-send-email-jrollins@finestructure.net> References: <1306619520-25730-1-git-send-email-jrollins@finestructure.net> <1306619520-25730-2-git-send-email-jrollins@finestructure.net> <1306619520-25730-3-git-send-email-jrollins@finestructure.net> <1306619520-25730-4-git-send-email-jrollins@finestructure.net> 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: Sat, 28 May 2011 21:52:12 -0000 These tests also use the new test_expect_equal_file test. --- test/search | 5 ----- test/search-output | 12 ++++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/search b/test/search index 0981f66..4835872 100755 --- a/test/search +++ b/test/search @@ -118,9 +118,4 @@ 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 diff --git a/test/search-output b/test/search-output index 1554eb1..8ba8acf 100755 --- a/test/search-output +++ b/test/search-output @@ -304,4 +304,16 @@ cat <EXPECTED EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "notmuch search for non-existent message prints nothing" +notmuch search "no-message-matches-this" > OUTPUT +echo -n >EXPECTED +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "notmuch search --format=json for non-existent message prints proper empty json" +notmuch search --format=json "no-message-matches-this" > OUTPUT +cat <EXPECTED +[] +EOF +test_expect_equal_file OUTPUT EXPECTED + test_done -- 1.7.4.4