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 8F6BB431FD2 for ; Tue, 24 Jul 2012 11:25:39 -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 LqXvZulCvelX for ; Tue, 24 Jul 2012 11:25:38 -0700 (PDT) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2960C431FB6 for ; Tue, 24 Jul 2012 11:25:38 -0700 (PDT) Received: by mail-wg0-f45.google.com with SMTP id dt14so5995257wgb.2 for ; Tue, 24 Jul 2012 11:25:37 -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=QJy4t4ksf8WaySTKWREcxMfI78PHMmerVlFsMsCXLO0=; b=GaLzUlVqzpem0oEhyAkqtZmjW/odkFUBqzg8+xwax5hN31YiEk6O/fcEsNANn4MtHy xTTXmm5vb+mcS/UI14hgsvtH3/HNNQMSLOwhrCbhs747V2gyDFVJIMODkD+FX+I8lz0U zsp6ua/6J5vWBMzSfvhNEojLKAe03g+IN8VSa5Epn7L/PD52sc0HAv/+4AQJiCQTtiF6 gA0Nx4pd6VBYTo039IrDZGrgx0XMAVAeistx4SY/P9aqjqVJhwNgr8tdv0rxEwn+kjhw FpECRlFqsloCT94NGgkaok6/EM+7m9RJ45gashXKr4B2tVaOUbKXTKg/fIxZhPqsGKF3 F2PQ== Received: by 10.216.235.102 with SMTP id t80mr415075weq.87.1343154327554; Tue, 24 Jul 2012 11:25:27 -0700 (PDT) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id y5sm5494691wiw.9.2012.07.24.11.25.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 11:25:26 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v2 (rebased) 2/4] test: add tests for the new --body=true|false option Date: Tue, 24 Jul 2012 19:23:28 +0100 Message-Id: <1343154210-26841-3-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1343154210-26841-1-git-send-email-markwalters1009@gmail.com> References: <1343154210-26841-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: Tue, 24 Jul 2012 18:25:39 -0000 --- test/json | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/test/json b/test/json index 337b3f5..831e105 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_json_show_sanitize | notmuch_search_sanitize) -- 1.7.9.1