[PATCH v4 4/5] test: notmuch search --format=text0
authorJani Nikula <jani@nikula.org>
Sun, 16 Dec 2012 22:05:12 +0000 (00:05 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:27 +0000 (09:52 -0800)
ef/fcde006dc10350c630dbac3ffd2b482e22d922 [new file with mode: 0644]

diff --git a/ef/fcde006dc10350c630dbac3ffd2b482e22d922 b/ef/fcde006dc10350c630dbac3ffd2b482e22d922
new file mode 100644 (file)
index 0000000..e875a79
--- /dev/null
@@ -0,0 +1,121 @@
+Return-Path: <jani@nikula.org>\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 D8108431FC2\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:30 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[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 LlNINCEBuUrn for <notmuch@notmuchmail.org>;\r
+       Sun, 16 Dec 2012 14:05:30 -0800 (PST)\r
+Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
+       [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D77E7431FC0\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:29 -0800 (PST)\r
+Received: by mail-lb0-f181.google.com with SMTP id ge1so4072163lbb.26\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:28 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
+       :in-reply-to:references:mime-version:content-type\r
+       :content-transfer-encoding:x-gm-message-state;\r
+       bh=CPmGVlt0caHT3RVwQria/4q2uxQVYuPOywHRZ2vtfjE=;\r
+       b=XqMycuJPiln112G9VaEeRlwKIWyGw4KA3CfRdx6d5Oo8p5rXrdQoHvi+YG6JEhXHmn\r
+       PEcMlXEgccJnXdpomsCDHWmiMqiPdtPbbm9kzIS0qysEQnh5L45rySwPaAEEN4fWQjvs\r
+       Lc+G+XoT5lRrVSuy7bMvu3yN1tPRlHH7V/vQQoicH8cXIno+Dy47PhfH7fgmgNllKbyU\r
+       um+hFCP4Bub8+9YosvahPfPKMnZ3WKgwUKsjQkUDoVwivIidNpM8tvEfv3d7tS/rdvzj\r
+       0u54xNw6CCB7KWvHwApd1wbPN5nX5wfO7ywjhQBJMS2ZyOiWZQCZ3/cN0uoJhnP1dxfI\r
+       hN1g==\r
+Received: by 10.152.144.164 with SMTP id sn4mr9119599lab.57.1355695528389;\r
+       Sun, 16 Dec 2012 14:05:28 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id gr12sm4118393lab.3.2012.12.16.14.05.26\r
+       (version=SSLv3 cipher=OTHER); Sun, 16 Dec 2012 14:05:27 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 4/5] test: notmuch search --format=text0\r
+Date: Mon, 17 Dec 2012 00:05:12 +0200\r
+Message-Id:\r
+ <b7ef9d7abc4ad4dd3677bbc0202253c84e26fbcd.1355695036.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1355695036.git.jani@nikula.org>\r
+References: <cover.1355695036.git.jani@nikula.org>\r
+In-Reply-To: <cover.1355695036.git.jani@nikula.org>\r
+References: <cover.1355695036.git.jani@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+X-Gm-Message-State:\r
+ ALoCoQnoftesaQxJXMznlMahJRS6kyiPtYPEKSh1VN7b4yT+Vk1xRhde+ujVb1gMDqTNtq161qGD\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, 16 Dec 2012 22:05:31 -0000\r
+\r
+---\r
+ test/text |   33 +++++++++++++++++++++++++++++++++\r
+ 1 file changed, 33 insertions(+)\r
+\r
+diff --git a/test/text b/test/text\r
+index 428c89b..b5ccefc 100755\r
+--- a/test/text\r
++++ b/test/text\r
+@@ -52,4 +52,37 @@ output=$(notmuch search --format=text "tëxt-search-méssage" | notmuch_search_s\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
++add_email_corpus\r
++\r
++test_begin_subtest "Search message tags: text0"\r
++cat <<EOF > EXPECTED\r
++attachment inbox signed unread\r
++EOF\r
++notmuch search --format=text0 --output=tags '*' | xargs -0 | notmuch_search_sanitize > OUTPUT\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++# Use tr(1) to convert --output=text0 to --output=text for\r
++# comparison. Also translate newlines to spaces to fail with more\r
++# noise if they are present as delimiters instead of null\r
++# characters. This assumes there are no newlines in the data.\r
++test_begin_subtest "Compare text vs. text0 for threads"\r
++notmuch search --format=text --output=threads '*' | notmuch_search_sanitize > EXPECTED\r
++notmuch search --format=text0 --output=threads '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++test_begin_subtest "Compare text vs. text0 for messages"\r
++notmuch search --format=text --output=messages '*' | notmuch_search_sanitize > EXPECTED\r
++notmuch search --format=text0 --output=messages '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++test_begin_subtest "Compare text vs. text0 for files"\r
++notmuch search --format=text --output=files '*' | notmuch_search_sanitize > EXPECTED\r
++notmuch search --format=text0 --output=files '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++test_begin_subtest "Compare text vs. text0 for tags"\r
++notmuch search --format=text --output=tags '*' | notmuch_search_sanitize > EXPECTED\r
++notmuch search --format=text0 --output=tags '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
+ test_done\r
+-- \r
+1.7.10.4\r
+\r