From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id BB206429E2F for ; Sat, 28 May 2011 14:52:24 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.608 X-Spam-Level: X-Spam-Status: No, score=-0.608 tagged_above=-999 required=5 tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3, URI_HEX=1.313] 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 I9LfXHTmp7-v for ; Sat, 28 May 2011 14:52:22 -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 0DCFF429E34 for ; Sat, 28 May 2011 14:52:15 -0700 (PDT) Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) by fire-doxen-postvirus (Postfix) with ESMTP id 71EAE2E50EF5; Sat, 28 May 2011 14:45:47 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on fire-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 fire-doxen-submit (Postfix) with ESMTP id 996EE2E50E7E; Sat, 28 May 2011 14:45:38 -0700 (PDT) Received: by servo.finestructure.net (Postfix, from userid 1000) id 1FD7F77C; Sat, 28 May 2011 14:52:05 -0700 (PDT) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH 03/25] test: modify search-output test to use the new test_expect_equal_file function Date: Sat, 28 May 2011 14:51:38 -0700 Message-Id: <1306619520-25730-4-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306619520-25730-3-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> 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:25 -0000 These test now properly test for the presence of a newline at the end of all output. Right now some of these test will fail because the search output is currently broken to *not* produce proper newlines in some cases. --- test/search-output | 72 ++++++++++++++++++++++++++++++++++----------------- 1 files changed, 48 insertions(+), 24 deletions(-) diff --git a/test/search-output b/test/search-output index 20341d6..1554eb1 100755 --- a/test/search-output +++ b/test/search-output @@ -5,8 +5,8 @@ test_description='various settings for "notmuch search --output="' add_email_corpus test_begin_subtest "notmuch search --output=threads" -output=$(notmuch search --output=threads '*' | sed -e s/thread:.*/thread:THREADID/) -test_expect_equal "$output" "thread:THREADID +notmuch search --output=threads '*' | sed -e s/thread:.*/thread:THREADID/ >OUTPUT +cat <EXPECTED thread:THREADID thread:THREADID thread:THREADID @@ -27,11 +27,15 @@ thread:THREADID thread:THREADID thread:THREADID thread:THREADID -thread:THREADID" +thread:THREADID +thread:THREADID +EOF +test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "notmuch search --format=json --output=threads" -output=$(notmuch search --format=json --output=threads '*' | sed -e s/\".*\"/\"THREADID\"/) -test_expect_equal "$output" '["THREADID", +notmuch search --format=json --output=threads '*' | sed -e s/\".*\"/\"THREADID\"/ >OUTPUT +cat <EXPECTED +["THREADID", "THREADID", "THREADID", "THREADID", @@ -52,11 +56,14 @@ test_expect_equal "$output" '["THREADID", "THREADID", "THREADID", "THREADID", -"THREADID"]' +"THREADID"] +EOF +test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "notmuch search --output=messages" -output=$(notmuch search --output=messages '*') -test_expect_equal "$output" "id:1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk +notmuch search --output=messages '*' >OUTPUT +cat <EXPECTED +id:1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk id:877htoqdbo.fsf@yoom.home.cworth.org id:878we4qdqf.fsf@yoom.home.cworth.org id:87aaykqe24.fsf@yoom.home.cworth.org @@ -105,11 +112,14 @@ id:87iqd9rn3l.fsf@vertex.dottedmag id:20091117190054.GU3165@dottiness.seas.harvard.edu id:87lji5cbwo.fsf@yoom.home.cworth.org id:1258471718-6781-2-git-send-email-dottedmag@dottedmag.net -id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net" +id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net +EOF +test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "notmuch search --format=json --output=messages" -output=$(notmuch search --format=json --output=messages '*') -test_expect_equal "$output" '["1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk", +notmuch search --format=json --output=messages '*' >OUTPUT +cat <EXPECTED +["1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk", "877htoqdbo.fsf@yoom.home.cworth.org", "878we4qdqf.fsf@yoom.home.cworth.org", "87aaykqe24.fsf@yoom.home.cworth.org", @@ -158,11 +168,14 @@ test_expect_equal "$output" '["1258544095-16616-1-git-send-email-chris@chris-wil "20091117190054.GU3165@dottiness.seas.harvard.edu", "87lji5cbwo.fsf@yoom.home.cworth.org", "1258471718-6781-2-git-send-email-dottedmag@dottedmag.net", -"1258471718-6781-1-git-send-email-dottedmag@dottedmag.net"]' +"1258471718-6781-1-git-send-email-dottedmag@dottedmag.net"] +EOF +test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "notmuch search --output=files" -output=$(notmuch search --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR,") -test_expect_equal "$output" "MAIL_DIR/cur/50:2, +notmuch search --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT +cat <EXPECTED +MAIL_DIR/cur/50:2, MAIL_DIR/cur/49:2, MAIL_DIR/cur/48:2, MAIL_DIR/cur/47:2, @@ -211,11 +224,14 @@ MAIL_DIR/cur/04:2, MAIL_DIR/cur/03:2, MAIL_DIR/cur/07:2, MAIL_DIR/cur/02:2, -MAIL_DIR/cur/01:2," +MAIL_DIR/cur/01:2, +EOF +test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "notmuch search --format=json --output=files" -output=$(notmuch search --format=json --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR,") -test_expect_equal "$output" '["MAIL_DIR/cur/50:2,", +notmuch search --format=json --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT +cat <EXPECTED +["MAIL_DIR/cur/50:2,", "MAIL_DIR/cur/49:2,", "MAIL_DIR/cur/48:2,", "MAIL_DIR/cur/47:2,", @@ -264,20 +280,28 @@ test_expect_equal "$output" '["MAIL_DIR/cur/50:2,", "MAIL_DIR/cur/03:2,", "MAIL_DIR/cur/07:2,", "MAIL_DIR/cur/02:2,", -"MAIL_DIR/cur/01:2,"]' +"MAIL_DIR/cur/01:2,"] +EOF +test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "notmuch search --output=tags" -output=$(notmuch search --output=tags '*') -test_expect_equal "$output" "attachment +notmuch search --output=tags '*' >OUTPUT +cat <EXPECTED +attachment inbox signed -unread" +unread +EOF +test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "notmuch search --format=json --output=tags" -output=$(notmuch search --format=json --output=tags '*') -test_expect_equal "$output" '["attachment", +notmuch search --format=json --output=tags '*' >OUTPUT +cat <EXPECTED +["attachment", "inbox", "signed", -"unread"]' +"unread"] +EOF +test_expect_equal_file OUTPUT EXPECTED test_done -- 1.7.4.4