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 87C53429E2F for ; Sun, 22 Jul 2012 07:38:18 -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 8Dcg7-wTF3G2 for ; Sun, 22 Jul 2012 07:38:16 -0700 (PDT) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 8B19B431FB6 for ; Sun, 22 Jul 2012 07:38:13 -0700 (PDT) Received: by mail-wi0-f179.google.com with SMTP id hq4so1563921wib.2 for ; Sun, 22 Jul 2012 07:38:13 -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=f6jmu3XZncueOLqAcFEAyQ9wR4sHczCRzQ4Ha5tShb0=; b=g9HMytcoRROkyPJy65b+KEAWxeBt314DP1UkswYhOHFQvmSbxGPO9UKboajomRLIiB cSAp1AU3GzZ8y3KllkvIKLTZjCBzAOFslWFv4gUUTvvud/mbtcVzlKAb5p0e+lssx4QQ tAeBaSSx/fHxmhuFmxNe8NMYkXk+juqEtuiVpkiUgdEDbdm0HVRVttx3dZMQm3Sxh/pv Zz3N2OSC4rxJgeR8N57jmlbYyHzvGfOEE0XPJiEO1Ab+a9DAusPi0QqjTs2N3uv8XR4S +LcMuMcx92ZTxBngLnDfyob539lcQcZ5/L39JvSRVxANP7vcNZ2fbFLntmM3+MuS3zVk kH2Q== Received: by 10.216.85.149 with SMTP id u21mr6701439wee.147.1342967893107; Sun, 22 Jul 2012 07:38:13 -0700 (PDT) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id ex20sm16719766wid.7.2012.07.22.07.38.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Jul 2012 07:38:12 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 3/4] test: add some tests for --include-text-content option Date: Sun, 22 Jul 2012 15:37:58 +0100 Message-Id: <1342967879-20453-4-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1342967879-20453-1-git-send-email-markwalters1009@gmail.com> References: <1342967879-20453-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: Sun, 22 Jul 2012 14:38:19 -0000 --- test/json | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/test/json b/test/json index 6439788..53cb039 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 --include-text-content=true" +output=$(notmuch show --format=json --include-text-content=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 --include-text-content=false" +output=$(notmuch show --format=json --include-text-content=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\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\"}]}, []]]]" + 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