[PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 8f / e21e6d597807ab4fdccd99b4ef7005cd023698
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 77773431FC0\r
6         for <notmuch@notmuchmail.org>; Sun,  2 Dec 2012 05:34:05 -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 kstfSjSd1+XW for <notmuch@notmuchmail.org>;\r
16         Sun,  2 Dec 2012 05:34:04 -0800 (PST)\r
17 Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
18         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 438BB431FAF\r
21         for <notmuch@notmuchmail.org>; Sun,  2 Dec 2012 05:33:52 -0800 (PST)\r
22 Received: from fctnnbsc30w-142167090129.dhcp-dynamic.fibreop.nb.bellaliant.net\r
23         ([142.167.90.129] helo=zancas.localnet)\r
24         by tesseract.cs.unb.ca with esmtpsa\r
25         (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)\r
26         (envelope-from <bremner@tethera.net>)\r
27         id 1Tf9g1-0005w5-1d; Sun, 02 Dec 2012 09:33:51 -0400\r
28 Received: from bremner by zancas.localnet with local (Exim 4.80)\r
29         (envelope-from <bremner@tethera.net>)\r
30         id 1Tf9fv-0001rk-Jl; Sun, 02 Dec 2012 09:33:39 -0400\r
31 From: david@tethera.net\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [patch v3 6/6] test: add broken roundtrip test\r
34 Date: Sun,  2 Dec 2012 09:33:24 -0400\r
35 Message-Id: <1354455204-6908-7-git-send-email-david@tethera.net>\r
36 X-Mailer: git-send-email 1.7.10.4\r
37 In-Reply-To: <1354455204-6908-1-git-send-email-david@tethera.net>\r
38 References: <1354455204-6908-1-git-send-email-david@tethera.net>\r
39 X-Spam_bar: -\r
40 Cc: David Bremner <bremner@debian.org>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Sun, 02 Dec 2012 13:34:05 -0000\r
54 \r
55 From: David Bremner <bremner@debian.org>\r
56 \r
57 We demonstrate the current notmuch restore parser being confused by\r
58 message-id's and tags containing non alpha numeric characters\r
59 (particularly space and parentheses are problematic because they are\r
60 not escaped by notmuch dump).\r
61 \r
62 We save the files as hex escaped on disk so that terminal emulators\r
63 will not get confused if the test fails (as we mostly expect it to do).\r
64 ---\r
65  test/dump-restore |   22 ++++++++++++++++++++++\r
66  1 file changed, 22 insertions(+)\r
67 \r
68 diff --git a/test/dump-restore b/test/dump-restore\r
69 index b05399c..adf0647 100755\r
70 --- a/test/dump-restore\r
71 +++ b/test/dump-restore\r
72 @@ -85,4 +85,26 @@ test_begin_subtest "dump --output=outfile -- from:cworth"\r
73  notmuch dump --output=dump-outfile-dash-inbox.actual -- from:cworth\r
74  test_expect_equal_file dump-cworth.expected dump-outfile-dash-inbox.actual\r
75  \r
76 +test_begin_subtest 'roundtripping random message-ids and tags'\r
77 +    test_subtest_known_broken\r
78 +    ${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \\r
79 +                       --num-messages=100\r
80 +\r
81 +     notmuch dump| \\r
82 +        ${TEST_DIRECTORY}/hex-xcode --direction=encode| \\r
83 +        sort > EXPECTED.$test_count\r
84 +\r
85 +     # delete every second tag\r
86 +     notmuch tag $(notmuch search --output=tags '*' | \\r
87 +        awk '{ if (NR % 2 == 0) printf " -'%s'", $1 }')  '*'\r
88 +\r
89 +     ${TEST_DIRECTORY}/hex-xcode --direction=decode < EXPECTED.$test_count | \\r
90 +        notmuch restore 2>/dev/null\r
91 +\r
92 +     notmuch dump| \\r
93 +        ${TEST_DIRECTORY}/hex-xcode --direction=encode| \\r
94 +        sort > OUTPUT.$test_count\r
95 +\r
96 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
97 +\r
98  test_done\r
99 -- \r
100 1.7.10.4\r
101 \r