From 82c21d6de828c89e7c87f411456310d00844f6bb Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Mon, 23 Jul 2012 18:57:37 +0100 Subject: [PATCH] [PATCH v2 2/4] test: add tests for the new --body=true|false option --- 7b/9d63593a58f6e2f26844ac1be1d92a0a484159 | 89 +++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 7b/9d63593a58f6e2f26844ac1be1d92a0a484159 diff --git a/7b/9d63593a58f6e2f26844ac1be1d92a0a484159 b/7b/9d63593a58f6e2f26844ac1be1d92a0a484159 new file mode 100644 index 000000000..7a0b6e77c --- /dev/null +++ b/7b/9d63593a58f6e2f26844ac1be1d92a0a484159 @@ -0,0 +1,89 @@ +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 1C505431FD0 + for ; Mon, 23 Jul 2012 10:57:53 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=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 5OmBxN6YBiSK for ; + Mon, 23 Jul 2012 10:57:51 -0700 (PDT) +Received: from mail-we0-f181.google.com (mail-we0-f181.google.com + [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 7C991431FC4 + for ; Mon, 23 Jul 2012 10:57:47 -0700 (PDT) +Received: by mail-we0-f181.google.com with SMTP id t57so4988618wey.26 + for ; Mon, 23 Jul 2012 10:57:47 -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=yfYE+//obOnHYjfRaSnSSvMW9cPetGf0Y1+gUFlfj64=; + b=SrG7Skykhn/WYEtZUkBlN1hE18auPEypx9vdX1DEmOLk500ebsPZ+tRkFUvW3w+9eg + +trjEUD4hy0MS2SIRDIAoNlnNW4RzV7KFDezlFr9ay2WNPynqLNmswmgB+Qzl8O2QUCd + QWXZmBfmUt9qfreyI9MgSneYHTYMMzd1uZSCIKrd8Ne3nRu3QsfdiKqa2/8txki9tmpN + ISfUJ8ttwZHhgRxqbvg6SkYXHJXfdKnOnh643ScbzIOAVXgV6QjGIX4a8YNvPq5+ZHWE + Cj4CHDTOslJb4lVK5XUf6X3hEhvJUvkR5QN3KPdI46I8e/YInPhVnDFxoIxpoYtj9H44 + al+g== +Received: by 10.180.81.133 with SMTP id a5mr32057454wiy.17.1343066267123; + Mon, 23 Jul 2012 10:57:47 -0700 (PDT) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + cl8sm18011864wib.10.2012.07.23.10.57.45 (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 23 Jul 2012 10:57:46 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v2 2/4] test: add tests for the new --body=true|false option +Date: Mon, 23 Jul 2012 18:57:37 +0100 +Message-Id: <1343066259-22523-3-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1343066259-22523-1-git-send-email-markwalters1009@gmail.com> +References: <1343066259-22523-1-git-send-email-markwalters1009@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: Mon, 23 Jul 2012 17:57:53 -0000 + +--- + test/json | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/test/json b/test/json +index 6439788..709b34f 100755 +--- a/test/json ++++ b/test/json +@@ -7,6 +7,15 @@ add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:0 + output=$(notmuch show --format=json "json-show-message") + test_expect_equal "$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 \", \"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 "$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 \", \"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 "$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 \", \"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\"" + output=$(notmuch search --format=json "json-search-message" | notmuch_search_sanitize) +-- +1.7.9.1 + -- 2.26.2