[PATCH 1/3] test: add basic show, search --format=text tests
authorPeter Wang <novalazy@gmail.com>
Sun, 24 Jun 2012 03:27:48 +0000 (13:27 +1000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:47:46 +0000 (09:47 -0800)
a6/e611d2e58626562c5146bba4d239592b7788e6 [new file with mode: 0644]

diff --git a/a6/e611d2e58626562c5146bba4d239592b7788e6 b/a6/e611d2e58626562c5146bba4d239592b7788e6
new file mode 100644 (file)
index 0000000..65cb600
--- /dev/null
@@ -0,0 +1,165 @@
+Return-Path: <novalazy@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1974E431FAF\r
+       for <notmuch@notmuchmail.org>; Sat, 23 Jun 2012 20:28:14 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Th37z4NMI0ZI for <notmuch@notmuchmail.org>;\r
+       Sat, 23 Jun 2012 20:28:13 -0700 (PDT)\r
+Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com\r
+       [209.85.210.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 55D65431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 23 Jun 2012 20:28:13 -0700 (PDT)\r
+Received: by dadg9 with SMTP id g9so4920782dad.26\r
+       for <notmuch@notmuchmail.org>; Sat, 23 Jun 2012 20:28:12 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:mime-version\r
+       :content-type:content-transfer-encoding;\r
+       bh=cuNoHQ6VzxVPHD7ncqZRlVttLZhRWO1aoMtFpa9p4vk=;\r
+       b=hUb+SJtjBgnjbLOqgxp7xpsVK08KFFMos1qLjUgrp3UZ8dzQL2ml6YSi9/NwxtYWIO\r
+       4QMabdQWC6DjSG9ZvyfK0F6sCx+TTcuFQA7mc/U7dfc2AWdH6HrTptQGtzHTuFG3vMn9\r
+       7X/X70XoRZmC3f96NDuCvX6VATizyk6bkahT7fpU/gN3D3rb9vW8auOYt92pIBtM/E9T\r
+       JpRkawVPzSstraeYz1WMh3dNiWd8YGJBZUkZrNd5kWATXIw8ygsU5b8qiM11bbopqlaZ\r
+       /+52H+xiNQT2xIbKyhEyegLsDZfPGbkFth4HEs/i65uPg27hirO2obztRVRVLA5uQY2N\r
+       K8LQ==\r
+Received: by 10.68.193.226 with SMTP id hr2mr25340510pbc.155.1340508492423;\r
+       Sat, 23 Jun 2012 20:28:12 -0700 (PDT)\r
+Received: from localhost (215.42.233.220.static.exetel.com.au.\r
+       [220.233.42.215])\r
+       by mx.google.com with ESMTPS id tm2sm4073738pbc.69.2012.06.23.20.28.09\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 23 Jun 2012 20:28:11 -0700 (PDT)\r
+From: Peter Wang <novalazy@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/3] test: add basic show, search --format=text tests\r
+Date: Sun, 24 Jun 2012 13:27:48 +1000\r
+Message-Id: <1340508470-16606-1-git-send-email-novalazy@gmail.com>\r
+X-Mailer: git-send-email 1.7.4.4\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 24 Jun 2012 03:28:14 -0000\r
+\r
+There didn't seem to be these basic tests for --format=text,\r
+as there are for --format=json.  These are just the tests from\r
+the `json' script, with adjusted expected outputs.\r
+---\r
+ test/notmuch-test |    1 +\r
+ test/text         |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 2 files changed, 56 insertions(+), 0 deletions(-)\r
+ create mode 100755 test/text\r
+\r
+diff --git a/test/notmuch-test b/test/notmuch-test\r
+index bfad5d3..ea39dfc 100755\r
+--- a/test/notmuch-test\r
++++ b/test/notmuch-test\r
+@@ -31,6 +31,7 @@ TESTS="\r
+   excludes\r
+   tagging\r
+   json\r
++  text\r
+   multipart\r
+   thread-naming\r
+   raw\r
+diff --git a/test/text b/test/text\r
+new file mode 100755\r
+index 0000000..428c89b\r
+--- /dev/null\r
++++ b/test/text\r
+@@ -0,0 +1,55 @@\r
++#!/usr/bin/env bash\r
++test_description="--format=text output"\r
++. ./test-lib.sh\r
++\r
++test_begin_subtest "Show message: text"\r
++add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\""\r
++output=$(notmuch show --format=text "text-show-message" | notmuch_show_sanitize_all)\r
++test_expect_equal "$output" "\\r
++\f\r
+message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX\r
++\f\r
+header{\r
++Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (inbox unread)\r
++Subject: text-show-subject\r
++From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++Date: Sat, 01 Jan 2000 12:00:00 +0000\r
++\f\r
+header}\r
++\f\r
+body{\r
++\f\r
+part{ ID: 1, Content-type: text/plain\r
++text-show-message\r
++\f\r
+part}\r
++\f\r
+body}\r
++\f\r
+message}"\r
++\r
++test_begin_subtest "Search message: text"\r
++add_message "[subject]=\"text-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-search-message\""\r
++output=$(notmuch search --format=text "text-search-message" | notmuch_search_sanitize)\r
++test_expect_equal "$output" \\r
++"thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; text-search-subject (inbox unread)"\r
++\r
++test_begin_subtest "Show message: text, utf-8"\r
++add_message "[subject]=\"text-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"tëxt-show-méssage\""\r
++output=$(notmuch show --format=text "tëxt-show-méssage" | notmuch_show_sanitize_all)\r
++test_expect_equal "$output" "\\r
++\f\r
+message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX\r
++\f\r
+header{\r
++Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (inbox unread)\r
++Subject: text-show-utf8-body-sübjéct\r
++From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++Date: Sat, 01 Jan 2000 12:00:00 +0000\r
++\f\r
+header}\r
++\f\r
+body{\r
++\f\r
+part{ ID: 1, Content-type: text/plain\r
++tëxt-show-méssage\r
++\f\r
+part}\r
++\f\r
+body}\r
++\f\r
+message}"\r
++\r
++test_begin_subtest "Search message: text, utf-8"\r
++add_message "[subject]=\"text-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"tëxt-search-méssage\""\r
++output=$(notmuch search --format=text "tëxt-search-méssage" | notmuch_search_sanitize)\r
++test_expect_equal "$output" \\r
++"thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; text-search-utf8-body-sübjéct (inbox unread)"\r
++\r
++test_done\r
+-- \r
+1.7.4.4\r
+\r