From: Peter Wang Date: Tue, 30 Oct 2012 10:12:47 +0000 (+1100) Subject: [PATCH v2 2/2] test: add test for showing Reply-To headers X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1f6842859fbbb5e11ae576a78ce3d02d8d681835;p=notmuch-archives.git [PATCH v2 2/2] test: add test for showing Reply-To headers --- diff --git a/8e/32078d0648a7afffd231f14e33e56080c12a45 b/8e/32078d0648a7afffd231f14e33e56080c12a45 new file mode 100644 index 000000000..915580bba --- /dev/null +++ b/8e/32078d0648a7afffd231f14e33e56080c12a45 @@ -0,0 +1,98 @@ +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 1DED3431FC2 + for ; Tue, 30 Oct 2012 03:13:28 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 7WJ5sbUqIe1L for ; + Tue, 30 Oct 2012 03:13:26 -0700 (PDT) +Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com + [209.85.220.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 4BD34431FBD + for ; Tue, 30 Oct 2012 03:13:25 -0700 (PDT) +Received: by mail-pa0-f53.google.com with SMTP id bj3so66383pad.26 + for ; Tue, 30 Oct 2012 03:13:25 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=K+U93a8++aPJbxjCmQj6A51bKDAqwDrQj564+ybgHKQ=; + b=0S48RybvAXHN7bjenHJ/1EtuK2+rHWKF8Uw7KC70vjHTnGkvpl2TFfs/08HGnJETZr + /J8bQmwa5klbmwT8xCslgRw/bTPmh9zpTcFbMwHK5Akldni4LSIHofFm4uMZCc9XY0w/ + bLDyuctwAPbxA4511xIpisKUbURrIM7T8NGY5xdZkIgEx8cl7EKunsspjGlYtPmCbb98 + PvHH3UJdRmCS53BpItkJSmt6P/hakoirWHiZibVvN9BgIstJ/VAL5juaMRUFZAwhCEuC + 1lciRtByjjZhtu7QuHFhujJr7xyHDUuYKvJR1uGU1WKFuhQkC/OWPrD5NbNLVtKmRpBd + 74Uw== +Received: by 10.68.213.138 with SMTP id ns10mr100433640pbc.157.1351592005105; + Tue, 30 Oct 2012 03:13:25 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id ox7sm333598pbb.14.2012.10.30.03.13.22 + (version=TLSv1/SSLv3 cipher=OTHER); + Tue, 30 Oct 2012 03:13:24 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH v2 2/2] test: add test for showing Reply-To headers +Date: Tue, 30 Oct 2012 21:12:47 +1100 +Message-Id: <1351591967-17438-3-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.12.1 +In-Reply-To: <1351591967-17438-1-git-send-email-novalazy@gmail.com> +References: <1351591967-17438-1-git-send-email-novalazy@gmail.com> +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: Tue, 30 Oct 2012 10:13:28 -0000 + +Test that show --format=json now outputs Reply-To header fields when +present. +--- + test/json | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/test/json b/test/json +index 40d0ba3..bfafd55 100755 +--- a/test/json ++++ b/test/json +@@ -3,18 +3,18 @@ test_description="--format=json output" + . ./test-lib.sh + + test_begin_subtest "Show message: json" +-add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[body]=\"json-show-message\"" ++add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"json-show-message\"" + output=$(notmuch show --format=json "json-show-message") +-test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" ++test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" + + # This should be the same output as above. + test_begin_subtest "Show message: json --body=true" + output=$(notmuch show --format=json --body=true "json-show-message") +-test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Bcc\": \"test_suite+bcc@notmuchmail.org\",\"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" ++test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" + + test_begin_subtest "Show message: json --body=false" + output=$(notmuch show --format=json --body=false "json-show-message") +-test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Bcc\": \"test_suite+bcc@notmuchmail.org\",\"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]" ++test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]" + + test_begin_subtest "Search message: json" + add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\"" +-- +1.7.12.1 +