1 Return-Path: <bremner@tethera.net>
\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 arlo.cworth.org (Postfix) with ESMTP id 8C5CA6DE00CB
\r
6 for <notmuch@notmuchmail.org>; Sat, 19 Sep 2015 09:30:32 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.113 tagged_above=-999 required=5 tests=[AWL=0.113]
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id gitF3RI1j43o for <notmuch@notmuchmail.org>;
\r
16 Sat, 19 Sep 2015 09:30:31 -0700 (PDT)
\r
17 X-Greylist: delayed 2620 seconds by postgrey-1.35 at arlo;
\r
18 Sat, 19 Sep 2015 09:30:30 PDT
\r
19 Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])
\r
20 by arlo.cworth.org (Postfix) with ESMTPS id CB6DA6DE009A
\r
21 for <notmuch@notmuchmail.org>; Sat, 19 Sep 2015 09:30:30 -0700 (PDT)
\r
22 Received: from remotemail by gitolite.debian.net with local (Exim 4.80)
\r
23 (envelope-from <bremner@tethera.net>)
\r
24 id 1ZdKL1-0002fw-EB; Sat, 19 Sep 2015 15:46:07 +0000
\r
25 Received: (nullmailer pid 25920 invoked by uid 1000); Sat, 19 Sep 2015
\r
27 From: David Bremner <david@tethera.net>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [PATCH] test: add sanity tests for threading
\r
30 Date: Sat, 19 Sep 2015 12:45:42 -0300
\r
31 Message-Id: <1442677542-25879-1-git-send-email-david@tethera.net>
\r
32 X-Mailer: git-send-email 2.5.1
\r
34 <CAJhTkNh7_hXDLsAGyD7nwkXV4ca6ymkLtFG945USvfqK4ZJEdQ@mail.gmail.com>
\r
36 <CAJhTkNh7_hXDLsAGyD7nwkXV4ca6ymkLtFG945USvfqK4ZJEdQ@mail.gmail.com>
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.18
\r
40 List-Id: "Use and development of the notmuch mail system."
\r
41 <notmuch.notmuchmail.org>
\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
45 List-Post: <mailto:notmuch@notmuchmail.org>
\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
49 X-List-Received-Date: Sat, 19 Sep 2015 16:30:32 -0000
\r
51 These tests are inspired by a problem report
\r
53 id:CAJhTkNh7_hXDLsAGyD7nwkXV4ca6ymkLtFG945USvfqK4ZJEdQ@mail.gmail.com
\r
55 Of course I can't duplicate the mentioned problem, it probably depends
\r
56 on specific message data.
\r
58 test/T580-thread-search.sh | 42 ++++++++++++++++++++++++++++++++++++++++++
\r
59 1 file changed, 42 insertions(+)
\r
60 create mode 100755 test/T580-thread-search.sh
\r
62 diff --git a/test/T580-thread-search.sh b/test/T580-thread-search.sh
\r
63 new file mode 100755
\r
64 index 0000000..6f7106d
\r
66 +++ b/test/T580-thread-search.sh
\r
68 +#!/usr/bin/env bash
\r
70 +# Copyright (c) 2015 David Bremner
\r
73 +test_description='test of searching by thread-id'
\r
75 +. ./test-lib.sh || exit 1
\r
79 +test_begin_subtest "Every message is found in exactly one thread"
\r
83 +for id in $(notmuch search --output=messages '*'); do
\r
84 + count=$((count +1))
\r
85 + matches=$(notmuch search --output=threads "$id" | wc -l)
\r
86 + if [ "$matches" = 1 ]; then
\r
87 + success=$((success + 1))
\r
91 +test_expect_equal "$count" "$success"
\r
93 +test_begin_subtest "roundtripping message-ids via thread-ids"
\r
97 +for id in $(notmuch search --output=messages '*'); do
\r
98 + count=$((count +1))
\r
99 + thread=$(notmuch search --output=threads "$id")
\r
100 + matched=$(notmuch search --output=messages "$thread" | grep "$id")
\r
101 + if [ "$matched" = "$id" ]; then
\r
102 + success=$((success + 1))
\r
106 +test_expect_equal "$count" "$success"
\r