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 C7E11431FBD
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 05:15:50 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id ZaS-mX9I-H1s for <notmuch@notmuchmail.org>;
\r
17 Sat, 14 Apr 2012 05:15:49 -0700 (PDT)
\r
18 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com
\r
19 [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id B53C6431FC2
\r
22 for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 05:15:48 -0700 (PDT)
\r
23 Received: by mail-lb0-f181.google.com with SMTP id b5so40243lbd.26
\r
24 for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 05:15:48 -0700 (PDT)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=google.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
\r
28 :in-reply-to:references:x-gm-message-state;
\r
29 bh=4icud2k3D9dexyaQHCKv2ry0mDdnP93vBKQ77LS0JVg=;
\r
30 b=F346UZO+/GVKVDaSCDsoUpkwIN+D9Cfsu3q/lTV3lVqedVxv+t93ho4lqV9fHlSbJx
\r
31 GIWseTCSLofSlO9lnGKXGaKb5I2rcKgRK3d7pn8Y7VlWSTPWZ60TZz853VDNdKHVAtRi
\r
32 q+Ehxw3gkFMyzRXVAm4RnOUsabxud7u5Iwh+RauTbvhM0RVU+cGjZtV1sLOpWKQ9Kp43
\r
33 2/t7poPRo5mJ2GtF3PT7CzaxRdufVxXCWjq5am8V0DeTPeaAP4qU7nYJ1CwN3WxVfaO2
\r
34 YzrKT8VZ7z5j1O/wAaRaRma8QU0aED4Q1kSo7tKaTsW+V4X/lcLI7qO1LyJK4914xuu6
\r
36 Received: by 10.112.24.103 with SMTP id t7mr2221927lbf.22.1334405748249;
\r
37 Sat, 14 Apr 2012 05:15:48 -0700 (PDT)
\r
38 Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPS id oy17sm12644768lab.7.2012.04.14.05.15.46
\r
41 (version=SSLv3 cipher=OTHER); Sat, 14 Apr 2012 05:15:47 -0700 (PDT)
\r
42 From: Jani Nikula <jani@nikula.org>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v2 3/6] test/hex-escaping: new test for hex escaping routines
\r
45 Date: Sat, 14 Apr 2012 15:15:28 +0300
\r
47 <fb358caa4321aa0c1483556d8e082f356094009f.1334404979.git.jani@nikula.org>
\r
48 X-Mailer: git-send-email 1.7.5.4
\r
49 In-Reply-To: <cover.1334404979.git.jani@nikula.org>
\r
50 References: <cover.1334404979.git.jani@nikula.org>
\r
51 In-Reply-To: <cover.1334404979.git.jani@nikula.org>
\r
52 References: <cover.1334404979.git.jani@nikula.org>
\r
54 ALoCoQnI/3Vp5b1a/wFxI/U0A3ygejPb0Q6BhfEhNnzCt2nmy4N3K9QWWTB/l746rQnHhtfFpPHw
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Sat, 14 Apr 2012 12:15:51 -0000
\r
69 From: David Bremner <bremner@debian.org>
\r
71 These are more like unit tests, to (try to) make sure the library
\r
72 functionality is working before building more complicated things on
\r
75 test/hex-escaping | 26 ++++++++++++++++++++++++++
\r
76 test/notmuch-test | 1 +
\r
77 2 files changed, 27 insertions(+), 0 deletions(-)
\r
78 create mode 100755 test/hex-escaping
\r
80 diff --git a/test/hex-escaping b/test/hex-escaping
\r
81 new file mode 100755
\r
82 index 0000000..f34cc8c
\r
84 +++ b/test/hex-escaping
\r
86 +#!/usr/bin/env bash
\r
87 +test_description="hex encoding and decoding"
\r
90 +test_begin_subtest "round trip"
\r
91 +find $TEST_DIRECTORY/corpus -type f -print | sort | xargs cat > EXPECTED
\r
92 +$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED | $TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT
\r
93 +test_expect_equal_file OUTPUT EXPECTED
\r
95 +test_begin_subtest "punctuation"
\r
96 +tag1='comic_swear=$&^%$^%\\//-+$^%$'
\r
97 +tag_enc1=$($TEST_DIRECTORY/hex-xcode --direction=encode "$tag1")
\r
98 +test_expect_equal "$tag_enc1" "comic_swear=%24%26%5e%25%24%5e%25%5c%5c%2f%2f-+%24%5e%25%24"
\r
100 +test_begin_subtest "round trip newlines"
\r
101 +printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count
\r
102 +$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED.$test_count |\
\r
103 + $TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT.$test_count
\r
104 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
106 +test_begin_subtest "round trip 8bit chars"
\r
107 +echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count
\r
108 +$TEST_DIRECTORY/hex-xcode --direction=decode < EXPECTED.$test_count |\
\r
109 + $TEST_DIRECTORY/hex-xcode --direction=encode > OUTPUT.$test_count
\r
110 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
112 diff --git a/test/notmuch-test b/test/notmuch-test
\r
113 index 801df73..2d0b381 100755
\r
114 --- a/test/notmuch-test
\r
115 +++ b/test/notmuch-test
\r
116 @@ -57,6 +57,7 @@ TESTS="
\r
117 emacs-address-cleaning
\r
122 TESTS=${NOTMUCH_TESTS:=$TESTS}
\r