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 6DD03429E54
\r
6 for <notmuch@notmuchmail.org>; Wed, 14 Dec 2011 12:14:27 -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 JNyqMf6fTSeL for <notmuch@notmuchmail.org>;
\r
16 Wed, 14 Dec 2011 12:14:26 -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 DEB93429E4D
\r
21 for <notmuch@notmuchmail.org>; Wed, 14 Dec 2011 12:14:25 -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 pBEKEAvC007164
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Wed, 14 Dec 2011 16:14:13 -0400
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.77)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1RavDO-0001EE-4E; Wed, 14 Dec 2011 16:14:10 -0400
\r
31 From: David Bremner <david@tethera.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [Alpha Patch 1/2] test: add (currently broken) test 8 bit characters
\r
34 hex-escape and dump-restore
\r
35 Date: Wed, 14 Dec 2011 16:14:00 -0400
\r
36 Message-Id: <1323893641-4677-1-git-send-email-david@tethera.net>
\r
37 X-Mailer: git-send-email 1.7.7.3
\r
38 In-Reply-To: <1323808075-7417-7-git-send-email-david@tethera.net>
\r
39 References: <1323808075-7417-7-git-send-email-david@tethera.net>
\r
40 Cc: David Bremner <bremner@debian.org>, pere@hungry.com
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\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: Wed, 14 Dec 2011 20:14:27 -0000
\r
55 From: David Bremner <bremner@debian.org>
\r
57 The problem is a use of signed chars in places where unsigned
\r
58 chars (i.e. 0-255) should be used.
\r
61 Well, I did mention more tests were needed ;). I failed to test 8 bit
\r
62 (>127) stuff and sure enough it was broken. This sets up some tests
\r
63 to demonstrate the problem and the next patch fixes it.
\r
65 test/dump-restore | 9 +++++++--
\r
66 test/hex-escaping | 7 +++++++
\r
67 2 files changed, 14 insertions(+), 2 deletions(-)
\r
69 diff --git a/test/dump-restore b/test/dump-restore
\r
70 index 122de5c..eee1773 100755
\r
71 --- a/test/dump-restore
\r
72 +++ b/test/dump-restore
\r
73 @@ -106,11 +106,15 @@ enc1=$($TEST_DIRECTORY/hex-xcode e "$tag1")
\r
74 tag2=$(printf 'this\n tag\t has\n spaces')
\r
75 enc2=$($TEST_DIRECTORY/hex-xcode e "$tag2")
\r
77 +enc3='%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a'
\r
78 +tag3=$($TEST_DIRECTORY/hex-xcode d $enc3)
\r
80 notmuch dump --format=notmuch > BACKUP
\r
82 -notmuch tag +"$tag1" +"$tag2" -inbox -unread "*"
\r
83 +notmuch tag +"$tag1" +"$tag2" +"$tag3" -inbox -unread "*"
\r
85 test_begin_subtest 'format=notmuch, round trip with strange tags'
\r
86 + test_subtest_known_broken
\r
87 notmuch dump --format=notmuch > EXPECTED.$test_count
\r
88 notmuch dump --format=notmuch | notmuch restore --format=notmuch
\r
89 notmuch dump --format=notmuch > OUTPUT.$test_count
\r
90 @@ -118,9 +122,10 @@ test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
93 test_begin_subtest 'format=notmuch, checking encoded output'
\r
94 + test_subtest_known_broken
\r
95 cp /dev/null EXPECTED.$test_count
\r
96 notmuch dump --format=notmuch -- from:cworth |\
\r
97 - awk "{ print \$1 \" $enc1 $enc2\" }" > EXPECTED.$test_count
\r
98 + awk "{ print \$1 \" $enc1 $enc2 $enc3\" }" > EXPECTED.$test_count
\r
100 notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count
\r
101 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
102 diff --git a/test/hex-escaping b/test/hex-escaping
\r
103 index d0a993e..2053fb0 100755
\r
104 --- a/test/hex-escaping
\r
105 +++ b/test/hex-escaping
\r
106 @@ -17,4 +17,11 @@ printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count
\r
107 $TEST_DIRECTORY/hex-xcode e < EXPECTED.$test_count |\
\r
108 $TEST_DIRECTORY/hex-xcode d > OUTPUT.$test_count
\r
109 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
111 +test_begin_subtest "round trip 8bit chars"
\r
112 +test_subtest_known_broken
\r
113 +echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count
\r
114 +$TEST_DIRECTORY/hex-xcode d < EXPECTED.$test_count |\
\r
115 + $TEST_DIRECTORY/hex-xcode e > OUTPUT.$test_count
\r
116 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r