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