[PATCH v3 4/5] test: notmuch search --format=text0
authorJani Nikula <jani@nikula.org>
Sun, 16 Dec 2012 21:02:40 +0000 (23:02 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:26 +0000 (09:52 -0800)
6a/2e2e1e00a63f4176d2516cf84ff4c4987ea955 [new file with mode: 0644]

diff --git a/6a/2e2e1e00a63f4176d2516cf84ff4c4987ea955 b/6a/2e2e1e00a63f4176d2516cf84ff4c4987ea955
new file mode 100644 (file)
index 0000000..355d6c7
--- /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 66B95431FB6\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:59 -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 Wx8zx27ypPYQ for <notmuch@notmuchmail.org>;\r
+       Sun, 16 Dec 2012 13:02:59 -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 B7ABD431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:58 -0800 (PST)\r
+Received: by mail-lb0-f181.google.com with SMTP id ge1so4052287lbb.26\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:57 -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=f2yAc/XaUIL9nL+q4SuPnvX64uwNPisWpdvESnTx9PmEED87BM/cmZd5gzH8T5t6xU\r
+       6ap14yCIH6586MxY4BJrpkPXs926zLPm9QLjKCe6DRbRj8GtrpsnKoQHdLFccn1s2PCx\r
+       +7pkY+QR9amPhVIW24K5Qy6e/eyDg9mCdiSZ0UIWJ2Z92m8Xdl/B0XWNcA3BomWXeKlg\r
+       LQpSyCgWFoqtcJtQDzbmqOmWkbWxJlTB0NMjC7thUTlzhyeIRhTqFaeo6fhYTRfoV8Us\r
+       22qjBdYbgbAePZChEL0sEU0KwoSebvY6xBF1Ac2RAhfrZSK9BmTbmX9e/cme/+RWqCTO\r
+       /4BQ==\r
+Received: by 10.112.38.103 with SMTP id f7mr4720456lbk.120.1355691777328;\r
+       Sun, 16 Dec 2012 13:02:57 -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 ew10sm4114166lbb.10.2012.12.16.13.02.55\r
+       (version=SSLv3 cipher=OTHER); Sun, 16 Dec 2012 13:02:56 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 4/5] test: notmuch search --format=text0\r
+Date: Sun, 16 Dec 2012 23:02:40 +0200\r
+Message-Id:\r
+ <294c12ec82aa90f64d2dd4a99938a8f8459609b8.1355691124.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1355691124.git.jani@nikula.org>\r
+References: <cover.1355691124.git.jani@nikula.org>\r
+In-Reply-To: <cover.1355691124.git.jani@nikula.org>\r
+References: <cover.1355691124.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
+ ALoCoQlT/mfH9qEK0fHYSadTSIwq4Ye1bVADIfwbImxQP5HSOZVd09oGUfHBHzxKUMVoP2zD3t1v\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 21:02:59 -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