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 340E8431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:54:43 -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 UyyVazdViFw6 for <notmuch@notmuchmail.org>;
\r
18 Mon, 25 Jun 2012 13:54:42 -0700 (PDT)
\r
19 Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com
\r
20 [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 7547D431FAF
\r
23 for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:54:42 -0700 (PDT)
\r
24 Received: by wibhm2 with SMTP id hm2so404653wib.2
\r
25 for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:54:41 -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=i9NQOH7lckEe+/g2VY3ccvykzEp2yzRhSd0LsPexHbo=;
\r
29 b=lwqEPzoeY/VVp0wNbasDihVmXsN64ZcmHQgVVrQw7RlKlosPBdlQguitOE9TJf1+S4
\r
30 l/iZf3FrgkSSC4qRUmRT+KT1KaKi89t9WkNAQGorUlU1sKS/Bdhb5yFeCgRQgA4PTwW3
\r
31 KnHYciMc6PQTPtBgRS02sk9AlrYp73Da+WPzw9YGSt61TeoNMUx4O76bgwTONTWRDN1I
\r
32 PDbTHZstkiPWrO7QfZtrrgvx8kRNiGYOeUgYpluvXVJZZcAnhANI2kYbGO172XolCUw+
\r
33 2bItHEmaWdbjDveB/l0w5+z+bBih99C4cCm0W/1GHU1vEis+8aeYBQLFCR+H44bLK3ea
\r
35 Received: by 10.216.215.194 with SMTP id e44mr7462987wep.61.1340657681222;
\r
36 Mon, 25 Jun 2012 13:54:41 -0700 (PDT)
\r
37 Received: from localhost ([195.24.209.21])
\r
38 by mx.google.com with ESMTPS id eb8sm17682wib.11.2012.06.25.13.54.33
\r
39 (version=TLSv1/SSLv3 cipher=OTHER);
\r
40 Mon, 25 Jun 2012 13:54:40 -0700 (PDT)
\r
41 From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [RFC PATCH 13/14] Tests for mbox support
\r
44 Date: Mon, 25 Jun 2012 16:51:56 -0400
\r
45 Message-Id: <1340657517-6539-9-git-send-email-ethan@betacantrips.com>
\r
46 X-Mailer: git-send-email 1.7.9.5
\r
47 In-Reply-To: <1340657517-6539-1-git-send-email-ethan@betacantrips.com>
\r
48 References: <1340657517-6539-1-git-send-email-ethan@betacantrips.com>
\r
49 X-Mailman-Approved-At: Tue, 26 Jun 2012 03:51:54 -0700
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Mon, 25 Jun 2012 20:54:43 -0000
\r
64 These need to be improved, rather than hard-coding byte offsets.
\r
66 Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
\r
68 test/mbox | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
69 test/notmuch-test | 1 +
\r
70 2 files changed, 60 insertions(+)
\r
71 create mode 100755 test/mbox
\r
73 diff --git a/test/mbox b/test/mbox
\r
74 new file mode 100755
\r
75 index 0000000..f03f887
\r
79 +#!/usr/bin/env bash
\r
81 +# Copyright (c) 2005 Junio C Hamano
\r
84 +test_description='basic mbox support'
\r
87 +mkdir -p $MAIL_DIR/some-mboxes/subdir $MAIL_DIR/database $MAIL_DIR/corpus
\r
89 +# The Content-Length headers here include the final newline (added later).
\r
90 +generate_message '[body]="Mbox message 1."' '[header]="Content-Length: 16"' "[dir]=corpus"
\r
91 +generate_message '[body]="Mbox message 2. Longer."' '[header]="Content-Length: 24"' "[dir]=corpus"
\r
92 +generate_message '[body]="Mbox message 3."' "[dir]=corpus"
\r
93 +generate_message '[body]="Mbox message 4."' "[dir]=corpus"
\r
94 +generate_message '[body]="Mbox message 5. Last message."' '[header]="Content-Length: 30"' "[dir]=corpus"
\r
96 +MBOX1=$MAIL_DIR/some-mboxes/first.mbox
\r
97 +for x in $MAIL_DIR/corpus/*; do
\r
98 + echo "From MAILER-DAEMON Sat Jan 3 01:05:34 1996" >> $MBOX1
\r
104 +notmuch config set database.path $MAIL_DIR/database
\r
105 +notmuch config set new.scan mbox://$MAIL_DIR/some-mboxes
\r
107 +test_begin_subtest "read a small mbox (5 messages)"
\r
108 +output=$(NOTMUCH_NEW)
\r
109 +test_expect_equal "$output" "Added 5 new messages to the database."
\r
111 +test_begin_subtest "search"
\r
112 +output=$(notmuch search '*' | notmuch_search_sanitize)
\r
113 +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #1 (inbox unread)
\r
114 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #2 (inbox unread)
\r
115 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #3 (inbox unread)
\r
116 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #4 (inbox unread)
\r
117 +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #5 (inbox unread)"
\r
119 +test_begin_subtest "show (mboxcl)"
\r
120 +output=$(notmuch show "Test message #1" | grep -o "filename:[^ ]*")
\r
121 +test_expect_equal "$output" "filename:mbox://$MAIL_DIR/some-mboxes/first.mbox#44+246"
\r
123 +test_begin_subtest "show doesn't append an extra space at the end (mboxcl)"
\r
124 +output=$(notmuch show --format=raw "Test message #1" )
\r
125 +original=$(cat $MAIL_DIR/corpus/msg-001)
\r
126 +test_expect_equal "$output" "$original"
\r
128 +test_begin_subtest "show (non-cl)"
\r
129 +output=$(notmuch show "Test message #3" | grep -o "filename:[^ ]*")
\r
130 +test_expect_equal "$output" "filename:mbox://$MAIL_DIR/some-mboxes/first.mbox#634+227"
\r
132 +test_begin_subtest "show doesn't append an extra space at the end (non-cl)"
\r
133 +output=$(notmuch show --format=raw "Test message #3" )
\r
134 +original=$(cat $MAIL_DIR/corpus/msg-003)
\r
135 +test_expect_equal "$output" "$original"
\r
138 diff --git a/test/notmuch-test b/test/notmuch-test
\r
139 index bfad5d3..8cbb2cd 100755
\r
140 --- a/test/notmuch-test
\r
141 +++ b/test/notmuch-test
\r
142 @@ -47,6 +47,7 @@ TESTS="
\r
143 emacs-large-search-buffer
\r
144 emacs-subject-to-filename
\r
149 search-folder-coherence
\r