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 53411429E26
\r
6 for <notmuch@notmuchmail.org>; Sun, 18 Dec 2011 05:15:53 -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 qjQrK786Piix for <notmuch@notmuchmail.org>;
\r
16 Sun, 18 Dec 2011 05:15:52 -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 AA09F429E36
\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 pBIDFcX4017878
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Sun, 18 Dec 2011 09:15:39 -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-0008RJ-Gk; Sun, 18 Dec 2011 09:15:38 -0400
\r
31 From: David Bremner <david@tethera.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH Draft 2 3/9] test/hex-escaping: new test for hex escaping
\r
35 Date: Sun, 18 Dec 2011 09:15:05 -0400
\r
36 Message-Id: <1324214111-32079-4-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
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:53 -0000
\r
56 From: David Bremner <bremner@debian.org>
\r
58 These are more like unit tests, to (try to) make sure the library
\r
59 functionality is working before building more complicated things on
\r
62 test/hex-escaping | 26 ++++++++++++++++++++++++++
\r
63 test/notmuch-test | 1 +
\r
64 2 files changed, 27 insertions(+), 0 deletions(-)
\r
65 create mode 100755 test/hex-escaping
\r
67 diff --git a/test/hex-escaping b/test/hex-escaping
\r
68 new file mode 100755
\r
69 index 0000000..daa6446
\r
71 +++ b/test/hex-escaping
\r
73 +#!/usr/bin/env bash
\r
74 +test_description="hex encoding and decoding"
\r
77 +test_begin_subtest "round trip"
\r
78 +find $TEST_DIRECTORY/corpus -type f -print | sort | xargs cat > EXPECTED
\r
79 +$TEST_DIRECTORY/hex-xcode e < EXPECTED | $TEST_DIRECTORY/hex-xcode d > OUTPUT
\r
80 +test_expect_equal_file OUTPUT EXPECTED
\r
82 +test_begin_subtest "punctuation"
\r
83 +tag1='comic_swear=$&^%$^%\\//-+$^%$'
\r
84 +tag_enc1=$($TEST_DIRECTORY/hex-xcode e "$tag1")
\r
85 +test_expect_equal "$tag_enc1" "comic_swear=%24%26%5e%25%24%5e%25%5c%5c%2f%2f-+%24%5e%25%24"
\r
87 +test_begin_subtest "round trip newlines"
\r
88 +printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count
\r
89 +$TEST_DIRECTORY/hex-xcode e < EXPECTED.$test_count |\
\r
90 + $TEST_DIRECTORY/hex-xcode d > OUTPUT.$test_count
\r
91 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
93 +test_begin_subtest "round trip 8bit chars"
\r
94 +echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count
\r
95 +$TEST_DIRECTORY/hex-xcode d < EXPECTED.$test_count |\
\r
96 + $TEST_DIRECTORY/hex-xcode e > OUTPUT.$test_count
\r
97 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
99 diff --git a/test/notmuch-test b/test/notmuch-test
\r
100 index ded79e8..af72c73 100755
\r
101 --- a/test/notmuch-test
\r
102 +++ b/test/notmuch-test
\r
103 @@ -50,6 +50,7 @@ TESTS="
\r
109 TESTS=${NOTMUCH_TESTS:=$TESTS}
\r