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 F2DD5404511
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 17:40:46 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 qVV1Rjvmn7QZ for <notmuch@notmuchmail.org>;
\r
16 Sat, 14 Jan 2012 17:40:46 -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 D8185414391
\r
21 for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 17:40:45 -0800 (PST)
\r
22 Received: from zancas.localnet
\r
23 (fctnnbsc36w-156034076032.pppoe-dynamic.High-Speed.nb.bellaliant.net
\r
24 [156.34.76.32]) (authenticated bits=0)
\r
25 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id q0F1efsu008573
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Sat, 14 Jan 2012 21:40:44 -0400
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.77)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1RmF5N-00042y-IJ; Sat, 14 Jan 2012 21:40:41 -0400
\r
31 From: David Bremner <david@tethera.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH v3 07/10] test: second set of dump/restore --format=notmuch
\r
35 Date: Sat, 14 Jan 2012 21:40:21 -0400
\r
36 Message-Id: <1326591624-15493-8-git-send-email-david@tethera.net>
\r
37 X-Mailer: git-send-email 1.7.7.3
\r
38 In-Reply-To: <1326591624-15493-1-git-send-email-david@tethera.net>
\r
39 References: <874nwxbkhr.fsf@zancas.localnet>
\r
40 <1326591624-15493-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
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, 15 Jan 2012 01:40:47 -0000
\r
56 From: David Bremner <bremner@debian.org>
\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
61 We test each possible input to autodetection, both explicit (with
\r
62 --format=auto) and implicit (without --format).
\r
64 test/dump-restore | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
65 1 files changed, 66 insertions(+), 0 deletions(-)
\r
67 diff --git a/test/dump-restore b/test/dump-restore
\r
68 index 0e210d3..60ae68e 100755
\r
69 --- a/test/dump-restore
\r
70 +++ b/test/dump-restore
\r
71 @@ -94,4 +94,70 @@ notmuch dump --format=sup -- from:cworth | tr -d \(\) > EXPECTED.$test_count
\r
72 notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count
\r
73 test_expect_equal_file OUTPUT.$test_count EXPECTED.$test_count
\r
75 +test_begin_subtest "format=notmuch, # round-trip"
\r
76 +notmuch dump --format=sup | sort > EXPECTED.$test_count
\r
77 +notmuch dump --format=notmuch | notmuch restore --format=notmuch
\r
78 +notmuch dump --format=sup | sort > OUTPUT.$test_count
\r
79 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
81 +tag1='comic_swear=$&^%$^%\\//-+$^%$'
\r
82 +enc1=$($TEST_DIRECTORY/hex-xcode --direction=encode "$tag1")
\r
84 +tag2=$(printf 'this\n tag\t has\n spaces')
\r
85 +enc2=$($TEST_DIRECTORY/hex-xcode --direction=encode "$tag2")
\r
87 +enc3='%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a'
\r
88 +tag3=$($TEST_DIRECTORY/hex-xcode --direction=decode $enc3)
\r
90 +notmuch dump --format=notmuch > BACKUP
\r
92 +notmuch tag +"$tag1" +"$tag2" +"$tag3" -inbox -unread "*"
\r
94 +test_begin_subtest 'format=notmuch, round trip with strange tags'
\r
95 + notmuch dump --format=notmuch > EXPECTED.$test_count
\r
96 + notmuch dump --format=notmuch | notmuch restore --format=notmuch
\r
97 + notmuch dump --format=notmuch > OUTPUT.$test_count
\r
98 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
100 +test_begin_subtest 'format=notmuch, checking encoded output'
\r
101 + cp /dev/null EXPECTED.$test_count
\r
102 + notmuch dump --format=notmuch -- from:cworth |\
\r
103 + awk "{ print \$1 \" $enc1 $enc2 $enc3\" }" > EXPECTED.$test_count
\r
105 + notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count
\r
106 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
108 +test_begin_subtest 'restoring sane tags'
\r
109 + notmuch restore --format=notmuch < BACKUP
\r
110 + notmuch dump --format=notmuch > OUTPUT.$test_count
\r
111 +test_expect_equal_file BACKUP OUTPUT.$test_count
\r
113 +test_begin_subtest 'format=notmuch, restore=auto'
\r
114 + notmuch dump --format=notmuch > EXPECTED.$test_count
\r
115 + notmuch tag -inbox -unread "*"
\r
116 + notmuch restore --format=auto < EXPECTED.$test_count
\r
117 + notmuch dump --format=notmuch > OUTPUT.$test_count
\r
118 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
120 +test_begin_subtest 'format=sup, restore=auto'
\r
121 + notmuch dump --format=sup > EXPECTED.$test_count
\r
122 + notmuch tag -inbox -unread "*"
\r
123 + notmuch restore --format=auto < EXPECTED.$test_count
\r
124 + notmuch dump --format=sup > OUTPUT.$test_count
\r
125 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
127 +test_begin_subtest 'format=notmuch, restore=default'
\r
128 + notmuch dump --format=notmuch > EXPECTED.$test_count
\r
129 + notmuch tag -inbox -unread "*"
\r
130 + notmuch restore < EXPECTED.$test_count
\r
131 + notmuch dump --format=notmuch > OUTPUT.$test_count
\r
132 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
134 +test_begin_subtest 'format=sup, restore=default'
\r
135 + notmuch dump --format=sup > EXPECTED.$test_count
\r
136 + notmuch tag -inbox -unread "*"
\r
137 + notmuch restore < EXPECTED.$test_count
\r
138 + notmuch dump --format=sup > OUTPUT.$test_count
\r
139 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r