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 4B1D2431FAF
\r
6 for <notmuch@notmuchmail.org>; Wed, 26 Dec 2012 11:36:54 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 HPEo3BDpqT31 for <notmuch@notmuchmail.org>;
\r
16 Wed, 26 Dec 2012 11:36:53 -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 9E6A3431FAE
\r
21 for <notmuch@notmuchmail.org>; Wed, 26 Dec 2012 11:36:53 -0800 (PST)
\r
22 Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net
\r
23 ([156.34.82.78] 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 1TnwmX-0002oo-KX; Wed, 26 Dec 2012 15:36:50 -0400
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.80)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1TnwmS-0005eJ-3I; Wed, 26 Dec 2012 15:36:44 -0400
\r
31 From: david@tethera.net
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH 1/2] test/dump-restore: new tests for empty files and leading
\r
34 comments/whitespace.
\r
35 Date: Wed, 26 Dec 2012 15:36:32 -0400
\r
36 Message-Id: <1356550593-21683-1-git-send-email-david@tethera.net>
\r
37 X-Mailer: git-send-email 1.7.10.4
\r
39 Cc: David Bremner <bremner@debian.org>
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Wed, 26 Dec 2012 19:36:54 -0000
\r
54 From: David Bremner <bremner@debian.org>
\r
56 Three of these are marked broken; the third is a regression test,
\r
57 since it passes by virtue of batch-tag being the default input format.
\r
59 test/dump-restore | 42 ++++++++++++++++++++++++++++++++++++++++++
\r
60 1 file changed, 42 insertions(+)
\r
62 diff --git a/test/dump-restore b/test/dump-restore
\r
63 index 6a989b6..c2ddb92 100755
\r
64 --- a/test/dump-restore
\r
65 +++ b/test/dump-restore
\r
66 @@ -136,6 +136,48 @@ notmuch dump --format=batch-tag > BACKUP
\r
68 notmuch tag +"$tag1" +"$tag2" +"$tag3" -inbox -unread "*"
\r
70 +# initial segment of file used for several tests below.
\r
71 +cat <<EOF > comments-and-blanks
\r
72 +# this is a comment
\r
74 +# next line has leading whitespace
\r
79 +test_begin_subtest 'restoring empty file is not an error'
\r
80 +test_subtest_known_broken
\r
81 +notmuch restore < /dev/null 2>OUTPUT.$test_count
\r
82 +cp /dev/null EXPECTED
\r
83 +test_expect_equal_file EXPECTED OUTPUT.$test_count
\r
85 +test_begin_subtest 'file of comments and blank lines is not an error'
\r
86 +test_subtest_known_broken
\r
87 +notmuch restore --input=comments-and-blanks
\r
89 +test_expect_equal "$ret_val" "0"
\r
91 +cp comments-and-blanks leading-comments-blanks-batch-tag
\r
92 +echo "+some_tag -- id:yun1vjwegii.fsf@aiko.keithp.com" \
\r
93 + >> leading-comments-blanks-batch-tag
\r
95 +test_begin_subtest 'detect format=batch-tag with leading comments and blanks'
\r
96 +notmuch restore --input=leading-comments-blanks-batch-tag
\r
97 +notmuch search --output=tags id:yun1vjwegii.fsf@aiko.keithp.com > OUTPUT.$test_count
\r
98 +echo "some_tag" > EXPECTED
\r
99 +test_expect_equal_file EXPECTED OUTPUT.$test_count
\r
101 +cp comments-and-blanks leading-comments-blanks-sup
\r
102 +echo "yun1vjwegii.fsf@aiko.keithp.com (another_tag)" \
\r
103 + >> leading-comments-blanks-sup
\r
105 +test_begin_subtest 'detect format=sup with leading comments and blanks'
\r
106 +test_subtest_known_broken
\r
107 +notmuch restore --input=leading-comments-blanks-sup
\r
108 +notmuch search --output=tags id:yun1vjwegii.fsf@aiko.keithp.com > OUTPUT.$test_count
\r
109 +echo "another_tag" > EXPECTED
\r
110 +test_expect_equal_file EXPECTED OUTPUT.$test_count
\r
112 test_begin_subtest 'format=batch-tag, round trip with strange tags'
\r
113 notmuch dump --format=batch-tag > EXPECTED.$test_count
\r
114 notmuch dump --format=batch-tag | notmuch restore --format=batch-tag
\r