Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / d0 / a2681b94a51e04085e85fc14b67a38c30b6a1f
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 olra.theworths.org (Postfix) with ESMTP id 6DBB5429E32\r
6         for <notmuch@notmuchmail.org>; Sat,  8 Mar 2014 13:21:20 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id OpG1Lt08veZl for <notmuch@notmuchmail.org>;\r
16         Sat,  8 Mar 2014 13:21:14 -0800 (PST)\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
18         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 9969F431FC9\r
21         for <notmuch@notmuchmail.org>; Sat,  8 Mar 2014 13:20:37 -0800 (PST)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <bremner@tethera.net>)\r
24         id 1WMOfd-000599-19; Sat, 08 Mar 2014 17:20:37 -0400\r
25 Received: (nullmailer pid 28544 invoked by uid 1000); Sat, 08 Mar 2014\r
26         21:20:03 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: [Patch v3 09/15] test: add database upgrade test from format version\r
30         1 to 2\r
31 Date: Sat,  8 Mar 2014 17:19:39 -0400\r
32 Message-Id: <1394313585-28422-10-git-send-email-david@tethera.net>\r
33 X-Mailer: git-send-email 1.8.5.3\r
34 In-Reply-To: <1394313585-28422-1-git-send-email-david@tethera.net>\r
35 References: <1394313585-28422-1-git-send-email-david@tethera.net>\r
36 X-BeenThere: notmuch@notmuchmail.org\r
37 X-Mailman-Version: 2.1.13\r
38 Precedence: list\r
39 List-Id: "Use and development of the notmuch mail system."\r
40         <notmuch.notmuchmail.org>\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
44 List-Post: <mailto:notmuch@notmuchmail.org>\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
48 X-List-Received-Date: Sat, 08 Mar 2014 21:21:21 -0000\r
49 \r
50 From: Jani Nikula <jani@nikula.org>\r
51 \r
52 Test the upgrade from probabilistic to boolean folder: terms, and\r
53 addition of path: terms.\r
54 \r
55 The test depends on the pre-built test corpus and database tarball and\r
56 checksum file being in place. If it's not, the test is skipped. The\r
57 mechanism to fetch the test database will be added later.\r
58 \r
59 At the time of writing, a working test database and checksum file is\r
60 available at\r
61 \r
62    http://notmuchmail.org/releases/test-databases/\r
63 \r
64 It has been noted that some non-GNU environments make lack\r
65 sha256sum. We leave this portability issue for a followup patch.\r
66 ---\r
67  test/T530-upgrade.sh | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++\r
68  1 file changed, 115 insertions(+)\r
69  create mode 100755 test/T530-upgrade.sh\r
70 \r
71 diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh\r
72 new file mode 100755\r
73 index 0000000..a3c2ed1\r
74 --- /dev/null\r
75 +++ b/test/T530-upgrade.sh\r
76 @@ -0,0 +1,115 @@\r
77 +#!/usr/bin/env bash\r
78 +test_description="database upgrade"\r
79 +\r
80 +. ./test-lib.sh\r
81 +\r
82 +dbtarball=folders-v1.tar.xz\r
83 +\r
84 +# XXX: Accomplish the same with test lib helpers\r
85 +if [ ! -e ${TEST_DIRECTORY}/test-databases/${dbtarball} ]; then\r
86 +    test_subtest_missing_external_prereq_["${dbtarball}"]=t\r
87 +fi\r
88 +\r
89 +test_expect_success \\r
90 +    'database checksum' \\r
91 +    '( cd $TEST_DIRECTORY/test-databases &&\r
92 +       sha256sum --quiet --check --status ${dbtarball}.sha256 )'\r
93 +\r
94 +tar xf $TEST_DIRECTORY/test-databases/${dbtarball} -C ${MAIL_DIR} --strip-components=1\r
95 +\r
96 +test_begin_subtest "folder: search does not work with old database version"\r
97 +output=$(notmuch search folder:foo)\r
98 +test_expect_equal "$output" ""\r
99 +\r
100 +test_begin_subtest "path: search does not work with old database version"\r
101 +output=$(notmuch search path:foo)\r
102 +test_expect_equal "$output" ""\r
103 +\r
104 +test_begin_subtest "database upgrade from format version 1"\r
105 +output=$(notmuch new)\r
106 +test_expect_equal "$output" "\\r
107 +Welcome to a new version of notmuch! Your database will now be upgraded.\r
108 +Your notmuch database has now been upgraded to database format version 2.\r
109 +No new mail."\r
110 +\r
111 +test_begin_subtest "folder: no longer matches in the middle of path"\r
112 +output=$(notmuch search folder:baz)\r
113 +test_expect_equal "$output" ""\r
114 +\r
115 +test_begin_subtest "folder: search"\r
116 +output=$(notmuch search --output=files folder:foo | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort)\r
117 +# bar/baz/05:2, and new/03:2, are duplicates of foo/05:2, and\r
118 +# foo/new/03:2, respectively\r
119 +test_expect_equal "$output" "MAIL_DIR/bar/baz/05:2,\r
120 +MAIL_DIR/foo/05:2,\r
121 +MAIL_DIR/foo/06:2,\r
122 +MAIL_DIR/foo/cur/07:2,\r
123 +MAIL_DIR/foo/cur/08:2,\r
124 +MAIL_DIR/foo/new/03:2,\r
125 +MAIL_DIR/foo/new/09:2,\r
126 +MAIL_DIR/foo/new/10:2,\r
127 +MAIL_DIR/new/03:2,"\r
128 +\r
129 +test_begin_subtest "top level folder: search"\r
130 +output=$(notmuch search --output=files folder:'""' | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort)\r
131 +# foo/new/03:2, is a duplicate of new/03:2,\r
132 +test_expect_equal "$output" "MAIL_DIR/01:2,\r
133 +MAIL_DIR/02:2,\r
134 +MAIL_DIR/cur/29:2,\r
135 +MAIL_DIR/cur/30:2,\r
136 +MAIL_DIR/cur/31:2,\r
137 +MAIL_DIR/cur/32:2,\r
138 +MAIL_DIR/cur/33:2,\r
139 +MAIL_DIR/cur/34:2,\r
140 +MAIL_DIR/cur/35:2,\r
141 +MAIL_DIR/cur/36:2,\r
142 +MAIL_DIR/cur/37:2,\r
143 +MAIL_DIR/cur/38:2,\r
144 +MAIL_DIR/cur/39:2,\r
145 +MAIL_DIR/cur/40:2,\r
146 +MAIL_DIR/cur/41:2,\r
147 +MAIL_DIR/cur/42:2,\r
148 +MAIL_DIR/cur/43:2,\r
149 +MAIL_DIR/cur/44:2,\r
150 +MAIL_DIR/cur/45:2,\r
151 +MAIL_DIR/cur/46:2,\r
152 +MAIL_DIR/cur/47:2,\r
153 +MAIL_DIR/cur/48:2,\r
154 +MAIL_DIR/cur/49:2,\r
155 +MAIL_DIR/cur/50:2,\r
156 +MAIL_DIR/cur/52:2,\r
157 +MAIL_DIR/cur/53:2,\r
158 +MAIL_DIR/foo/new/03:2,\r
159 +MAIL_DIR/new/03:2,\r
160 +MAIL_DIR/new/04:2,"\r
161 +\r
162 +test_begin_subtest "path: search"\r
163 +output=$(notmuch search --output=files path:"bar" | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort)\r
164 +# foo/05:2, is a duplicate of bar/baz/05:2,\r
165 +test_expect_equal "$output" "MAIL_DIR/bar/17:2,\r
166 +MAIL_DIR/bar/18:2,"\r
167 +\r
168 +test_begin_subtest "top level path: search"\r
169 +output=$(notmuch search --output=files path:'""' | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort)\r
170 +test_expect_equal "$output" "MAIL_DIR/01:2,\r
171 +MAIL_DIR/02:2,"\r
172 +\r
173 +test_begin_subtest "recursive path: search"\r
174 +output=$(notmuch search --output=files path:"bar/**" | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort)\r
175 +# foo/05:2, is a duplicate of bar/baz/05:2,\r
176 +test_expect_equal "$output" "MAIL_DIR/bar/17:2,\r
177 +MAIL_DIR/bar/18:2,\r
178 +MAIL_DIR/bar/baz/05:2,\r
179 +MAIL_DIR/bar/baz/23:2,\r
180 +MAIL_DIR/bar/baz/24:2,\r
181 +MAIL_DIR/bar/baz/cur/25:2,\r
182 +MAIL_DIR/bar/baz/cur/26:2,\r
183 +MAIL_DIR/bar/baz/new/27:2,\r
184 +MAIL_DIR/bar/baz/new/28:2,\r
185 +MAIL_DIR/bar/cur/19:2,\r
186 +MAIL_DIR/bar/cur/20:2,\r
187 +MAIL_DIR/bar/new/21:2,\r
188 +MAIL_DIR/bar/new/22:2,\r
189 +MAIL_DIR/foo/05:2,"\r
190 +\r
191 +test_done\r
192 -- \r
193 1.8.5.3\r
194 \r