1 Return-Path: <ethan.glasser.camp@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 829AD431FD5
\r
6 for <notmuch@notmuchmail.org>; Sun, 1 Jul 2012 09:47:14 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=1.061 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_BL_SPAMCOP_NET=1.246,
\r
14 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_WEB=0.614] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id vz3QHKHt2eE5 for <notmuch@notmuchmail.org>;
\r
18 Sun, 1 Jul 2012 09:47:14 -0700 (PDT)
\r
19 Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com
\r
20 [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
21 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
22 C2A98431FAF for <notmuch@notmuchmail.org>; Sun, 1 Jul 2012 09:47:13 -0700
\r
24 Received: by mail-wg0-f45.google.com with SMTP id dt14so3721202wgb.2
\r
25 for <notmuch@notmuchmail.org>; Sun, 01 Jul 2012 09:47:13 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=mtYHygXgzv3nMRpX+wAW/18klYYP2+BiWuN+1uTQG1o=;
\r
29 b=DZMSliZMlucIORZe30/2QJGjnvV+NWML+j8xTi15r82PXe9cLoTmOMb/LWmTFB1tOa
\r
30 8K1fGqb6NX4oQGF8UtAJy3SsV9y+uAULoWxaqlBfcR5jFqzlHcs6e/zas7oC7S9Pz3Sd
\r
31 hzHSz9Xa5Yig/tV0YPJiLTdJNX2NeQz3Kp5MkPm1nvJ/ujMKIHp1b6FdihA7nOVHzl6s
\r
32 5Z9QTbphDDp+xlByaUpr929PRj0WMGXxFEEDqVu9hqi10T4TfisNXGJKBQ2pmhg6MyJU
\r
33 kSb1TDSycdLxUkZXbW6DPcZGAOjgd8JSPGqbiulkc9wHb9cwVUzWgukkPNZhvSpaLUAK
\r
35 Received: by 10.180.95.135 with SMTP id dk7mr17909232wib.14.1341161233408;
\r
36 Sun, 01 Jul 2012 09:47:13 -0700 (PDT)
\r
37 Received: from localhost ([195.24.209.21])
\r
38 by mx.google.com with ESMTPS id k8sm35174447wia.6.2012.07.01.09.47.06
\r
39 (version=TLSv1/SSLv3 cipher=OTHER);
\r
40 Sun, 01 Jul 2012 09:47:12 -0700 (PDT)
\r
41 From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH v2 7/8] Tests for mbox support
\r
44 Date: Sun, 1 Jul 2012 12:39:49 -0400
\r
45 Message-Id: <1341160790-14525-8-git-send-email-ethan@betacantrips.com>
\r
46 X-Mailer: git-send-email 1.7.9.5
\r
47 In-Reply-To: <1341160790-14525-1-git-send-email-ethan@betacantrips.com>
\r
49 <CAOJ+Ob0MSOez2MvD2fCgF7t32kFPk4g2+xCud88QmBLt_b5pOA@mail.gmail.com>
\r
50 <1341160790-14525-1-git-send-email-ethan@betacantrips.com>
\r
51 Cc: Ethan Glasser-Camp <ethan@betacantrips.com>
\r
52 X-BeenThere: notmuch@notmuchmail.org
\r
53 X-Mailman-Version: 2.1.13
\r
55 List-Id: "Use and development of the notmuch mail system."
\r
56 <notmuch.notmuchmail.org>
\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
60 List-Post: <mailto:notmuch@notmuchmail.org>
\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
64 X-List-Received-Date: Sun, 01 Jul 2012 16:47:14 -0000
\r
66 These are simple tests of one single mbox.
\r
68 Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
\r
70 The test uses bash arrays, which have a slightly odd syntax for
\r
73 test/mbox | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
74 test/notmuch-test | 1 +
\r
75 2 files changed, 64 insertions(+)
\r
76 create mode 100755 test/mbox
\r
78 diff --git a/test/mbox b/test/mbox
\r
79 new file mode 100755
\r
80 index 0000000..a6dab99
\r
84 +#!/usr/bin/env bash
\r
86 +# Copyright (c) 2005 Junio C Hamano
\r
89 +test_description='basic mbox support'
\r
92 +mkdir -p $MAIL_DIR/some-mboxes/subdir $MAIL_DIR/database $MAIL_DIR/corpus
\r
94 +# The Content-Length headers here include the final newline (added later).
\r
95 +generate_message '[body]="Mbox message 1."' '[header]="Content-Length: 16"' "[dir]=corpus"
\r
96 +generate_message '[body]="Mbox message 2. Longer."' '[header]="Content-Length: 24"' "[dir]=corpus"
\r
97 +generate_message '[body]="Mbox message 3."' "[dir]=corpus"
\r
98 +generate_message '[body]="Mbox message 4."' "[dir]=corpus"
\r
99 +generate_message '[body]="Mbox message 5. Last message."' '[header]="Content-Length: 30"' "[dir]=corpus"
\r
101 +MBOX1=$MAIL_DIR/some-mboxes/first.mbox
\r
102 +declare -a starts lengths
\r
104 +for x in $MAIL_DIR/corpus/*; do
\r
105 + echo "From MAILER-DAEMON Sat Jan 3 01:05:34 1996" >> $MBOX1
\r
106 + starts+=(`wc -c $MBOX1 | cut -f 1 -d ' '`)
\r
108 + lengths+=(`wc -c $x | cut -f 1 -d ' '`)
\r
113 +notmuch config set database.path $MAIL_DIR/database
\r
114 +notmuch config set new.scan mbox://$MAIL_DIR/some-mboxes
\r
116 +test_begin_subtest "read a small mbox (5 messages)"
\r
117 +output=$(NOTMUCH_NEW)
\r
118 +test_expect_equal "$output" "Added 5 new messages to the database."
\r
120 +test_begin_subtest "search"
\r
121 +output=$(notmuch search '*' | notmuch_search_sanitize)
\r
122 +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #1 (inbox unread)
\r
123 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #2 (inbox unread)
\r
124 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #3 (inbox unread)
\r
125 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #4 (inbox unread)
\r
126 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #5 (inbox unread)"
\r
128 +test_begin_subtest "show (mboxcl)"
\r
129 +output=$(notmuch show "Test message #1" | grep -o "filename:[^ ]*")
\r
130 +test_expect_equal "$output" "filename:mbox://$MAIL_DIR/some-mboxes/first.mbox#${starts[0]}+${lengths[0]}"
\r
132 +test_begin_subtest "show doesn't append an extra space at the end (mboxcl)"
\r
133 +output=$(notmuch show --format=raw "Test message #1" )
\r
134 +original=$(cat $MAIL_DIR/corpus/msg-001)
\r
135 +test_expect_equal "$output" "$original"
\r
137 +test_begin_subtest "show (non-cl)"
\r
138 +output=$(notmuch show "Test message #3" | grep -o "filename:[^ ]*")
\r
139 +test_expect_equal "$output" "filename:mbox://$MAIL_DIR/some-mboxes/first.mbox#${starts[2]}+${lengths[2]}"
\r
141 +test_begin_subtest "show doesn't append an extra space at the end (non-cl)"
\r
142 +output=$(notmuch show --format=raw "Test message #3" )
\r
143 +original=$(cat $MAIL_DIR/corpus/msg-003)
\r
144 +test_expect_equal "$output" "$original"
\r
147 diff --git a/test/notmuch-test b/test/notmuch-test
\r
148 index bfad5d3..8cbb2cd 100755
\r
149 --- a/test/notmuch-test
\r
150 +++ b/test/notmuch-test
\r
151 @@ -47,6 +47,7 @@ TESTS="
\r
152 emacs-large-search-buffer
\r
153 emacs-subject-to-filename
\r
158 search-folder-coherence
\r