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 D8F3A4143AB
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 17:41:04 -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 xnp6cGgkodxp for <notmuch@notmuchmail.org>;
\r
16 Sat, 14 Jan 2012 17:41:03 -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 9D18641439F
\r
21 for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 17:40:52 -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 q0F1efgc008569
\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-00042l-0e; 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 03/10] test/hex-escaping: new test for hex escaping
\r
35 Date: Sat, 14 Jan 2012 21:40:17 -0400
\r
36 Message-Id: <1326591624-15493-4-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:41:05 -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..f34cc8c
\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 --direction=encode < EXPECTED | $TEST_DIRECTORY/hex-xcode --direction=decode > 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 --direction=encode "$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 --direction=encode < EXPECTED.$test_count |\
\r
90 + $TEST_DIRECTORY/hex-xcode --direction=decode > 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 --direction=decode < EXPECTED.$test_count |\
\r
96 + $TEST_DIRECTORY/hex-xcode --direction=encode > 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 6a99ae3..cbe2ef9 100755
\r
101 --- a/test/notmuch-test
\r
102 +++ b/test/notmuch-test
\r
103 @@ -52,6 +52,7 @@ TESTS="
\r
109 TESTS=${NOTMUCH_TESTS:=$TESTS}
\r