Re: Hi all
[notmuch-archives.git] / 5b / 79a1421087c59f55ac1e16e805a0cb38d007fc
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 87BA7429E26\r
6         for <notmuch@notmuchmail.org>; Sun, 18 Dec 2011 05:15:51 -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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 D5Rf74Hu4pgu for <notmuch@notmuchmail.org>;\r
16         Sun, 18 Dec 2011 05:15:50 -0800 (PST)\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 791E6429E33\r
21         for <notmuch@notmuchmail.org>; Sun, 18 Dec 2011 05:15:43 -0800 (PST)\r
22 Received: from zancas.localnet\r
23         (fctnnbsc36w-156034079193.pppoe-dynamic.High-Speed.nb.bellaliant.net\r
24         [156.34.79.193]) (authenticated bits=0)\r
25         by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pBIDFdH8017882\r
26         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
27         Sun, 18 Dec 2011 09:15:40 -0400\r
28 Received: from bremner by zancas.localnet with local (Exim 4.77)\r
29         (envelope-from <bremner@tethera.net>)\r
30         id 1RcGaY-0008RV-VW; Sun, 18 Dec 2011 09:15:39 -0400\r
31 From: David Bremner <david@tethera.net>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH Draft 2 7/9] test: second set of dump/restore --format=notmuch\r
34         tests\r
35 Date: Sun, 18 Dec 2011 09:15:09 -0400\r
36 Message-Id: <1324214111-32079-8-git-send-email-david@tethera.net>\r
37 X-Mailer: git-send-email 1.7.7.3\r
38 In-Reply-To: <1324214111-32079-1-git-send-email-david@tethera.net>\r
39 References: <id:87sjkmuck7.fsf@gmail.com>\r
40         <1324214111-32079-1-git-send-email-david@tethera.net>\r
41 Cc: David Bremner <bremner@debian.org>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Sun, 18 Dec 2011 13:15:52 -0000\r
55 \r
56 From: David Bremner <bremner@debian.org>\r
57 \r
58 These one need the completed functionality in notmuch-restore. Fairly\r
59 exotic tags are tested, but no weird message id's.\r
60 ---\r
61  test/dump-restore |   36 ++++++++++++++++++++++++++++++++++++\r
62  1 files changed, 36 insertions(+), 0 deletions(-)\r
63 \r
64 diff --git a/test/dump-restore b/test/dump-restore\r
65 index 48caf4e..ef4a63e 100755\r
66 --- a/test/dump-restore\r
67 +++ b/test/dump-restore\r
68 @@ -94,4 +94,40 @@ notmuch dump --format=sup -- from:cworth | tr -d \(\) > EXPECTED.$test_count\r
69  notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count\r
70  test_expect_equal_file OUTPUT.$test_count EXPECTED.$test_count\r
71  \r
72 +test_begin_subtest "format=notmuch, # round-trip"\r
73 +notmuch dump --format=sup | sort > EXPECTED.$test_count\r
74 +notmuch dump --format=notmuch | notmuch restore --format=notmuch\r
75 +notmuch dump --format=sup | sort > OUTPUT.$test_count\r
76 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
77 +\r
78 +tag1='comic_swear=$&^%$^%\\//-+$^%$'\r
79 +enc1=$($TEST_DIRECTORY/hex-xcode e "$tag1")\r
80 +\r
81 +tag2=$(printf 'this\n tag\t has\n spaces')\r
82 +enc2=$($TEST_DIRECTORY/hex-xcode e "$tag2")\r
83 +\r
84 +enc3='%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a'\r
85 +tag3=$($TEST_DIRECTORY/hex-xcode d $enc3)\r
86 +\r
87 +notmuch dump --format=notmuch > BACKUP\r
88 +\r
89 +notmuch tag +"$tag1" +"$tag2" +"$tag3" -inbox -unread "*"\r
90 +\r
91 +test_begin_subtest 'format=notmuch, round trip with strange tags'\r
92 +    notmuch dump --format=notmuch > EXPECTED.$test_count\r
93 +    notmuch dump --format=notmuch | notmuch restore --format=notmuch\r
94 +    notmuch dump --format=notmuch > OUTPUT.$test_count\r
95 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
96 +\r
97 +\r
98 +test_begin_subtest 'format=notmuch, checking encoded output'\r
99 +    cp /dev/null EXPECTED.$test_count\r
100 +    notmuch dump --format=notmuch -- from:cworth |\\r
101 +        awk "{ print \$1 \" $enc1 $enc2 $enc3\" }" > EXPECTED.$test_count\r
102 +\r
103 +    notmuch dump --format=notmuch -- from:cworth  > OUTPUT.$test_count\r
104 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
105 +\r
106 +notmuch restore --format=notmuch < BACKUP\r
107 +\r
108  test_done\r
109 -- \r
110 1.7.7.3\r
111 \r