"snoozing" with notmuch?
[notmuch-archives.git] / de / e8b03f4eb6d967760479aa7ebe16da90de6ef0
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 CB86B431FBF\r
6         for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 11:05:27 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 te6cZYZlLsvj for <notmuch@notmuchmail.org>;\r
16         Sun, 18 Nov 2012 11:05:26 -0800 (PST)\r
17 Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
18         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 67FBF431FC4\r
21         for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 11:05:18 -0800 (PST)\r
22 Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net\r
23         ([156.34.89.108] helo=zancas.localnet)\r
24         by tesseract.cs.unb.ca with esmtpsa\r
25         (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)\r
26         (envelope-from <bremner@tethera.net>)\r
27         id 1TaABB-000283-2w; Sun, 18 Nov 2012 15:05:17 -0400\r
28 Received: from bremner by zancas.localnet with local (Exim 4.80)\r
29         (envelope-from <bremner@tethera.net>)\r
30         id 1TaAB5-0001IK-Gn; Sun, 18 Nov 2012 15:05:11 -0400\r
31 From: david@tethera.net\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH 03/16] test/hex-escaping: new test for hex escaping routines\r
34 Date: Sun, 18 Nov 2012 15:04:45 -0400\r
35 Message-Id: <1353265498-3839-4-git-send-email-david@tethera.net>\r
36 X-Mailer: git-send-email 1.7.10.4\r
37 In-Reply-To: <1353265498-3839-1-git-send-email-david@tethera.net>\r
38 References: <1353265498-3839-1-git-send-email-david@tethera.net>\r
39 X-Spam_bar: -\r
40 Cc: David Bremner <bremner@debian.org>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\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: Sun, 18 Nov 2012 19:05:28 -0000\r
54 \r
55 From: David Bremner <bremner@debian.org>\r
56 \r
57 These are more like unit tests, to (try to) make sure the library\r
58 functionality is working before building more complicated things on\r
59 top of it.\r
60 ---\r
61  test/hex-escaping |   26 ++++++++++++++++++++++++++\r
62  test/notmuch-test |    1 +\r
63  2 files changed, 27 insertions(+)\r
64  create mode 100755 test/hex-escaping\r
65 \r
66 diff --git a/test/hex-escaping b/test/hex-escaping\r
67 new file mode 100755\r
68 index 0000000..f34cc8c\r
69 --- /dev/null\r
70 +++ b/test/hex-escaping\r
71 @@ -0,0 +1,26 @@\r
72 +#!/usr/bin/env bash\r
73 +test_description="hex encoding and decoding"\r
74 +. ./test-lib.sh\r
75 +\r
76 +test_begin_subtest "round trip"\r
77 +find $TEST_DIRECTORY/corpus -type f -print | sort | xargs cat > EXPECTED\r
78 +$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED | $TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT\r
79 +test_expect_equal_file OUTPUT EXPECTED\r
80 +\r
81 +test_begin_subtest "punctuation"\r
82 +tag1='comic_swear=$&^%$^%\\//-+$^%$'\r
83 +tag_enc1=$($TEST_DIRECTORY/hex-xcode --direction=encode "$tag1")\r
84 +test_expect_equal "$tag_enc1" "comic_swear=%24%26%5e%25%24%5e%25%5c%5c%2f%2f-+%24%5e%25%24"\r
85 +\r
86 +test_begin_subtest "round trip newlines"\r
87 +printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count\r
88 +$TEST_DIRECTORY/hex-xcode --direction=encode  < EXPECTED.$test_count |\\r
89 +       $TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT.$test_count\r
90 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
91 +\r
92 +test_begin_subtest "round trip 8bit chars"\r
93 +echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count\r
94 +$TEST_DIRECTORY/hex-xcode --direction=decode  < EXPECTED.$test_count |\\r
95 +       $TEST_DIRECTORY/hex-xcode --direction=encode > OUTPUT.$test_count\r
96 +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
97 +test_done\r
98 diff --git a/test/notmuch-test b/test/notmuch-test\r
99 index 9a1b375..d2e90e2 100755\r
100 --- a/test/notmuch-test\r
101 +++ b/test/notmuch-test\r
102 @@ -60,6 +60,7 @@ TESTS="\r
103    emacs-hello\r
104    emacs-show\r
105    missing-headers\r
106 +  hex-escaping\r
107    parse-time-string\r
108    search-date\r
109  "\r
110 -- \r
111 1.7.10.4\r
112 \r