1 Return-Path: <jani@nikula.org>
\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 D3B98431FAF
\r
6 for <notmuch@notmuchmail.org>; Sun, 2 Dec 2012 07:29:13 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 xLEX3OWwE1az for <notmuch@notmuchmail.org>;
\r
16 Sun, 2 Dec 2012 07:29:09 -0800 (PST)
\r
17 Received: from mail-la0-f53.google.com (mail-la0-f53.google.com
\r
18 [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id BE941431FAE
\r
21 for <notmuch@notmuchmail.org>; Sun, 2 Dec 2012 07:29:08 -0800 (PST)
\r
22 Received: by mail-la0-f53.google.com with SMTP id w12so1686792lag.26
\r
23 for <notmuch@notmuchmail.org>; Sun, 02 Dec 2012 07:29:07 -0800 (PST)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=google.com; s=20120113;
\r
26 h=from:to:cc:subject:in-reply-to:references:user-agent:date
\r
27 :message-id:mime-version:content-type:x-gm-message-state;
\r
28 bh=DIgSAf21MSIjKeg5qF9QapWw4gfKauUOCR09ohm0dWM=;
\r
29 b=HHYs+usESMYNpelpJFD/IIsjBPJREXXFJKt9/Rt54Z2UnaBqbuFuKkAKEeaDYL4K3l
\r
30 ivOe2ESNtWpq/voWhDq138pBEDNGaI3zA0aAOVym9YDtcmkjZH/FgZaxjDdr/UBlg4jf
\r
31 rM57l4pPea1NMaexUUDG/6y+kEAYbSy76NFCLkt+8c4ETD4cUhA7WNsOjxIGdADUvs8n
\r
32 mf4mzPh0FSTqkZQZzCjQ30uxxuV9xeAr3NJ5up57ebQSnn9VR7WedGy7srREnWynIgoG
\r
33 0jNVXv//Q8TFIn5wlODyvGWqGdvYNy7fQbTaH5DyGFNkBMN3T3vpy0uR19dh8oru97FD
\r
35 Received: by 10.112.84.102 with SMTP id x6mr3282820lby.35.1354462144399;
\r
36 Sun, 02 Dec 2012 07:29:04 -0800 (PST)
\r
37 Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.
\r
39 by mx.google.com with ESMTPS id p9sm4239752lbc.3.2012.12.02.07.29.02
\r
40 (version=SSLv3 cipher=OTHER); Sun, 02 Dec 2012 07:29:03 -0800 (PST)
\r
41 From: Jani Nikula <jani@nikula.org>
\r
42 To: david@tethera.net, notmuch@notmuchmail.org
\r
43 Subject: Re: [patch v3 3/6] test/hex-escaping: new test for hex escaping
\r
45 In-Reply-To: <1354455204-6908-4-git-send-email-david@tethera.net>
\r
46 References: <1354455204-6908-1-git-send-email-david@tethera.net>
\r
47 <1354455204-6908-4-git-send-email-david@tethera.net>
\r
48 User-Agent: Notmuch/0.14+124~g3b17402 (http://notmuchmail.org) Emacs/23.4.1
\r
50 Date: Sun, 02 Dec 2012 17:29:00 +0200
\r
51 Message-ID: <87obiccw1v.fsf@nikula.org>
\r
53 Content-Type: text/plain; charset=us-ascii
\r
55 ALoCoQkDmIOMhh7c6FCG8L/YeuMEQ9dcWiSBaEA6wQZd2c4sBpuYOttx0VRX3YG1ma2S/Y0l1r/Y
\r
56 Cc: David Bremner <bremner@debian.org>
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.13
\r
60 List-Id: "Use and development of the notmuch mail system."
\r
61 <notmuch.notmuchmail.org>
\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
65 List-Post: <mailto:notmuch@notmuchmail.org>
\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
69 X-List-Received-Date: Sun, 02 Dec 2012 15:29:14 -0000
\r
71 On Sun, 02 Dec 2012, david@tethera.net wrote:
\r
72 > From: David Bremner <bremner@debian.org>
\r
74 > These are more like unit tests, to (try to) make sure the library
\r
75 > functionality is working before building more complicated things on
\r
78 > test/hex-escaping | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
\r
79 > test/notmuch-test | 1 +
\r
80 > 2 files changed, 51 insertions(+)
\r
81 > create mode 100755 test/hex-escaping
\r
83 > diff --git a/test/hex-escaping b/test/hex-escaping
\r
84 > new file mode 100755
\r
85 > index 0000000..3f107dd
\r
87 > +++ b/test/hex-escaping
\r
89 > +#!/usr/bin/env bash
\r
90 > +test_description="hex encoding and decoding"
\r
93 > +test_begin_subtest "round trip"
\r
94 > +find $TEST_DIRECTORY/corpus -type f -print | sort | xargs cat > EXPECTED
\r
95 > +$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED | $TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT
\r
96 > +test_expect_equal_file OUTPUT EXPECTED
\r
98 > +test_begin_subtest "punctuation"
\r
99 > +tag1='comic_swear=$&^%$^%\\//-+$^%$'
\r
100 > +tag_enc1=$($TEST_DIRECTORY/hex-xcode --direction=encode "$tag1")
\r
101 > +test_expect_equal "$tag_enc1" "comic_swear=%24%26%5e%25%24%5e%25%5c%5c%2f%2f-+%24%5e%25%24"
\r
103 > +test_begin_subtest "round trip newlines"
\r
104 > +printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count
\r
105 > +$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED.$test_count |\
\r
106 > + $TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT.$test_count
\r
107 > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
109 > +test_begin_subtest "round trip 8bit chars"
\r
110 > +echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count
\r
111 > +$TEST_DIRECTORY/hex-xcode --in-place --direction=decode < EXPECTED.$test_count |\
\r
113 Did you intend to use --in-place here?
\r
118 > + $TEST_DIRECTORY/hex-xcode --direction=encode > OUTPUT.$test_count
\r
119 > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
121 > +test_begin_subtest "round trip (in-place)"
\r
122 > +find $TEST_DIRECTORY/corpus -type f -print | sort | xargs cat > EXPECTED
\r
123 > +$TEST_DIRECTORY/hex-xcode --in-place --direction=encode < EXPECTED |\
\r
124 > + $TEST_DIRECTORY/hex-xcode --in-place --direction=decode > OUTPUT
\r
125 > +test_expect_equal_file OUTPUT EXPECTED
\r
127 > +test_begin_subtest "punctuation (in-place)"
\r
128 > +tag1='comic_swear=$&^%$^%\\//-+$^%$'
\r
129 > +tag_enc1=$($TEST_DIRECTORY/hex-xcode --in-place --direction=encode "$tag1")
\r
130 > +test_expect_equal "$tag_enc1" "comic_swear=%24%26%5e%25%24%5e%25%5c%5c%2f%2f-+%24%5e%25%24"
\r
132 > +test_begin_subtest "round trip newlines (in-place)"
\r
133 > +printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count
\r
134 > +$TEST_DIRECTORY/hex-xcode --in-place --direction=encode < EXPECTED.$test_count |\
\r
135 > + $TEST_DIRECTORY/hex-xcode --in-place --direction=decode > OUTPUT.$test_count
\r
136 > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
138 > +test_begin_subtest "round trip 8bit chars (in-place)"
\r
139 > +echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count
\r
140 > +$TEST_DIRECTORY/hex-xcode --in-place --direction=decode < EXPECTED.$test_count |\
\r
141 > + $TEST_DIRECTORY/hex-xcode --in-place --direction=encode > OUTPUT.$test_count
\r
142 > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
145 > diff --git a/test/notmuch-test b/test/notmuch-test
\r
146 > index f275439..a6ef34f 100755
\r
147 > --- a/test/notmuch-test
\r
148 > +++ b/test/notmuch-test
\r
149 > @@ -60,6 +60,7 @@ TESTS="
\r
154 > parse-time-string
\r
160 > _______________________________________________
\r
161 > notmuch mailing list
\r
162 > notmuch@notmuchmail.org
\r
163 > http://notmuchmail.org/mailman/listinfo/notmuch
\r