From d0fc5497eb82542680f4bd38171a0e215293c201 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 16 Dec 2012 23:02:40 +0200 Subject: [PATCH] [PATCH v3 4/5] test: notmuch search --format=text0 --- 6a/2e2e1e00a63f4176d2516cf84ff4c4987ea955 | 121 ++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 6a/2e2e1e00a63f4176d2516cf84ff4c4987ea955 diff --git a/6a/2e2e1e00a63f4176d2516cf84ff4c4987ea955 b/6a/2e2e1e00a63f4176d2516cf84ff4c4987ea955 new file mode 100644 index 000000000..355d6c7df --- /dev/null +++ b/6a/2e2e1e00a63f4176d2516cf84ff4c4987ea955 @@ -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 66B95431FB6 + for ; Sun, 16 Dec 2012 13:02:59 -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 Wx8zx27ypPYQ for ; + Sun, 16 Dec 2012 13:02:59 -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 B7ABD431FAE + for ; Sun, 16 Dec 2012 13:02:58 -0800 (PST) +Received: by mail-lb0-f181.google.com with SMTP id ge1so4052287lbb.26 + for ; Sun, 16 Dec 2012 13:02:57 -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=f2yAc/XaUIL9nL+q4SuPnvX64uwNPisWpdvESnTx9PmEED87BM/cmZd5gzH8T5t6xU + 6ap14yCIH6586MxY4BJrpkPXs926zLPm9QLjKCe6DRbRj8GtrpsnKoQHdLFccn1s2PCx + +7pkY+QR9amPhVIW24K5Qy6e/eyDg9mCdiSZ0UIWJ2Z92m8Xdl/B0XWNcA3BomWXeKlg + LQpSyCgWFoqtcJtQDzbmqOmWkbWxJlTB0NMjC7thUTlzhyeIRhTqFaeo6fhYTRfoV8Us + 22qjBdYbgbAePZChEL0sEU0KwoSebvY6xBF1Ac2RAhfrZSK9BmTbmX9e/cme/+RWqCTO + /4BQ== +Received: by 10.112.38.103 with SMTP id f7mr4720456lbk.120.1355691777328; + Sun, 16 Dec 2012 13:02:57 -0800 (PST) +Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi. + [80.223.81.27]) + by mx.google.com with ESMTPS id ew10sm4114166lbb.10.2012.12.16.13.02.55 + (version=SSLv3 cipher=OTHER); Sun, 16 Dec 2012 13:02:56 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v3 4/5] test: notmuch search --format=text0 +Date: Sun, 16 Dec 2012 23:02:40 +0200 +Message-Id: + <294c12ec82aa90f64d2dd4a99938a8f8459609b8.1355691124.git.jani@nikula.org> +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: + ALoCoQlT/mfH9qEK0fHYSadTSIwq4Ye1bVADIfwbImxQP5HSOZVd09oGUfHBHzxKUMVoP2zD3t1v +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 21:02:59 -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 + -- 2.26.2