1 Return-Path: <novalazy@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 1974E431FAF
\r
6 for <notmuch@notmuchmail.org>; Sat, 23 Jun 2012 20:28:14 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id Th37z4NMI0ZI for <notmuch@notmuchmail.org>;
\r
17 Sat, 23 Jun 2012 20:28:13 -0700 (PDT)
\r
18 Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com
\r
19 [209.85.210.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 55D65431FAE
\r
22 for <notmuch@notmuchmail.org>; Sat, 23 Jun 2012 20:28:13 -0700 (PDT)
\r
23 Received: by dadg9 with SMTP id g9so4920782dad.26
\r
24 for <notmuch@notmuchmail.org>; Sat, 23 Jun 2012 20:28:12 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=from:to:cc:subject:date:message-id:x-mailer:mime-version
\r
27 :content-type:content-transfer-encoding;
\r
28 bh=cuNoHQ6VzxVPHD7ncqZRlVttLZhRWO1aoMtFpa9p4vk=;
\r
29 b=hUb+SJtjBgnjbLOqgxp7xpsVK08KFFMos1qLjUgrp3UZ8dzQL2ml6YSi9/NwxtYWIO
\r
30 4QMabdQWC6DjSG9ZvyfK0F6sCx+TTcuFQA7mc/U7dfc2AWdH6HrTptQGtzHTuFG3vMn9
\r
31 7X/X70XoRZmC3f96NDuCvX6VATizyk6bkahT7fpU/gN3D3rb9vW8auOYt92pIBtM/E9T
\r
32 JpRkawVPzSstraeYz1WMh3dNiWd8YGJBZUkZrNd5kWATXIw8ygsU5b8qiM11bbopqlaZ
\r
33 /+52H+xiNQT2xIbKyhEyegLsDZfPGbkFth4HEs/i65uPg27hirO2obztRVRVLA5uQY2N
\r
35 Received: by 10.68.193.226 with SMTP id hr2mr25340510pbc.155.1340508492423;
\r
36 Sat, 23 Jun 2012 20:28:12 -0700 (PDT)
\r
37 Received: from localhost (215.42.233.220.static.exetel.com.au.
\r
39 by mx.google.com with ESMTPS id tm2sm4073738pbc.69.2012.06.23.20.28.09
\r
40 (version=TLSv1/SSLv3 cipher=OTHER);
\r
41 Sat, 23 Jun 2012 20:28:11 -0700 (PDT)
\r
42 From: Peter Wang <novalazy@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH 1/3] test: add basic show, search --format=text tests
\r
45 Date: Sun, 24 Jun 2012 13:27:48 +1000
\r
46 Message-Id: <1340508470-16606-1-git-send-email-novalazy@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.4.4
\r
49 Content-Type: text/plain; charset=UTF-8
\r
50 Content-Transfer-Encoding: 8bit
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Sun, 24 Jun 2012 03:28:14 -0000
\r
65 There didn't seem to be these basic tests for --format=text,
\r
66 as there are for --format=json. These are just the tests from
\r
67 the `json' script, with adjusted expected outputs.
\r
69 test/notmuch-test | 1 +
\r
70 test/text | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
71 2 files changed, 56 insertions(+), 0 deletions(-)
\r
72 create mode 100755 test/text
\r
74 diff --git a/test/notmuch-test b/test/notmuch-test
\r
75 index bfad5d3..ea39dfc 100755
\r
76 --- a/test/notmuch-test
\r
77 +++ b/test/notmuch-test
\r
78 @@ -31,6 +31,7 @@ TESTS="
\r
86 diff --git a/test/text b/test/text
\r
87 new file mode 100755
\r
88 index 0000000..428c89b
\r
92 +#!/usr/bin/env bash
\r
93 +test_description="--format=text output"
\r
96 +test_begin_subtest "Show message: text"
\r
97 +add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\""
\r
98 +output=$(notmuch show --format=text "text-show-message" | notmuch_show_sanitize_all)
\r
99 +test_expect_equal "$output" "\
\r
101 message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
\r
104 +Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (inbox unread)
\r
105 +Subject: text-show-subject
\r
106 +From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
107 +To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
108 +Date: Sat, 01 Jan 2000 12:00:00 +0000
\r
114 part{ ID: 1, Content-type: text/plain
\r
123 +test_begin_subtest "Search message: text"
\r
124 +add_message "[subject]=\"text-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-search-message\""
\r
125 +output=$(notmuch search --format=text "text-search-message" | notmuch_search_sanitize)
\r
126 +test_expect_equal "$output" \
\r
127 +"thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; text-search-subject (inbox unread)"
\r
129 +test_begin_subtest "Show message: text, utf-8"
\r
130 +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
131 +output=$(notmuch show --format=text "tëxt-show-méssage" | notmuch_show_sanitize_all)
\r
132 +test_expect_equal "$output" "\
\r
134 message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
\r
137 +Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (inbox unread)
\r
138 +Subject: text-show-utf8-body-sübjéct
\r
139 +From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
140 +To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
141 +Date: Sat, 01 Jan 2000 12:00:00 +0000
\r
147 part{ ID: 1, Content-type: text/plain
\r
156 +test_begin_subtest "Search message: text, utf-8"
\r
157 +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
158 +output=$(notmuch search --format=text "tëxt-search-méssage" | notmuch_search_sanitize)
\r
159 +test_expect_equal "$output" \
\r
160 +"thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; text-search-utf8-body-sübjéct (inbox unread)"
\r