[PATCH 1/2] test: Replying to an HTML-only message in emacs
[notmuch-archives.git] / ed / d0ad9d67f8a3f4a54409f663b9c454fd53333c
1 Return-Path: <dmitry.kurochkin@gmail.com>\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 89078429E21\r
6         for <notmuch@notmuchmail.org>; Sun, 11 Sep 2011 16:30:54 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, 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 F5OkBHHLR-GL for <notmuch@notmuchmail.org>;\r
17         Sun, 11 Sep 2011 16:30:54 -0700 (PDT)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
19         [209.85.214.53]) (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 AF461431FB6\r
22         for <notmuch@notmuchmail.org>; Sun, 11 Sep 2011 16:30:53 -0700 (PDT)\r
23 Received: by bkbzt12 with SMTP id zt12so1058939bkb.26\r
24         for <notmuch@notmuchmail.org>; Sun, 11 Sep 2011 16:30:50 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
27         :message-id:mime-version:content-type;\r
28         bh=Ckyu3lZmhtzm28pQPbhtrw8I9rbXf/w6+Wfjp96fj08=;\r
29         b=lwUMe+dHG6d7BEB1HanR/TdifgvOWpKx9py3KT/9hIVgVMVE9uz5NxIJAix8gwdr04\r
30         Jile8zvsTuPwo2jp19OG+tjR/zK3JuRmXrRP1k+v9qVd+jDOX6j0F0qNtMQshknciejS\r
31         zzy802WbVyDTiJtupwTsrLA1m8QNa4ktcE85Y=\r
32 Received: by 10.204.135.6 with SMTP id l6mr2582381bkt.284.1315783850827;\r
33         Sun, 11 Sep 2011 16:30:50 -0700 (PDT)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id l11sm4989720bkb.1.2011.09.11.16.30.47\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Sun, 11 Sep 2011 16:30:48 -0700 (PDT)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: david@tethera.net, notmuch@notmuchmail.org\r
40 Subject: Re: [PATCH] test: reset known_broken status in test_expect_equal and\r
41         test_expect_equal_file\r
42 In-Reply-To: <1315782714-32287-1-git-send-email-david@tethera.net>\r
43 References: <1309752441-10651-3-git-send-email-dmitry.kurochkin@gmail.com>\r
44         <1315782714-32287-1-git-send-email-david@tethera.net>\r
45 User-Agent: Notmuch/0.8-19-g1ca96a5 (http://notmuchmail.org) Emacs/23.3.1\r
46         (x86_64-pc-linux-gnu)\r
47 Date: Mon, 12 Sep 2011 03:30:54 +0400\r
48 Message-ID: <87r53mveq9.fsf@gmail.com>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=us-ascii\r
51 Cc: David Bremner <bremner@debian.org>\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Sun, 11 Sep 2011 23:30:54 -0000\r
65 \r
66 Hi David.\r
67 \r
68 On Sun, 11 Sep 2011 20:11:54 -0300, david@tethera.net wrote:\r
69 > From: David Bremner <bremner@debian.org>\r
70\r
71 > Commit 4cc6727 introduced the library function\r
72 > test_subtest_known_broken which sets a variable\r
73 > test_subtest_known_broken_ . Unfortunately this variable is not reset\r
74 > if test_begin_subtest is not called before the next\r
75 > test_expect_success or test_expect_failure.\r
76\r
77 > This commit remedies that, under the assumption that exactly one\r
78 > test_expect_equal or test_expect_equal_file will follow a\r
79 > test_begin_subtest\r
80 > ---\r
81\r
82 > Any comments on this? I didn't follow a lot of the original\r
83 > discussions on the test API very closely. Mainly I want to know if the \r
84 > assumption at the end of the commit message seems reasonable.\r
85\r
86 \r
87 IMHO this is not a good idea, because:\r
88 \r
89 1. It introduces multiple places where the flag is reset.  If new\r
90    test_expect_* functions are added in the future, there would be more\r
91    of these.  So it brings us more complex code, code duplication, more\r
92    chances for bugs, etc.\r
93 \r
94    This may be solved by code refactoring, but I am not sure.\r
95 \r
96 2. No support for tests with multiple test_expect_* calls.  I do not\r
97    know if it is used or works now, but the patch certainly does not\r
98    help in this respect.\r
99 \r
100 3. I thought that every test must start with a test_begin_subtest call.\r
101    So it is the right place to put all subtest initialization code to.\r
102    Is this not correct?  If it is correct, then I do not understand why\r
103    we should support buggy tests by hiding (some of) their bugs.  Why do\r
104    we need it?\r
105 \r
106 Regards,\r
107   Dmitry\r
108 \r
109 >  test/test-lib.sh |    2 ++\r
110 >  1 files changed, 2 insertions(+), 0 deletions(-)\r
111\r
112 > diff --git a/test/test-lib.sh b/test/test-lib.sh\r
113 > index 196ef49..3c2768c 100755\r
114 > --- a/test/test-lib.sh\r
115 > +++ b/test/test-lib.sh\r
116 > @@ -460,6 +460,7 @@ test_expect_equal ()\r
117 >                       test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"\r
118 >               fi\r
119 >      fi\r
120 > +       test_subtest_known_broken_=\r
121 >  }\r
122 >  \r
123 >  test_expect_equal_file ()\r
124 > @@ -483,6 +484,7 @@ test_expect_equal_file ()\r
125 >                       test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"\r
126 >               fi\r
127 >      fi\r
128 > +     test_subtest_known_broken_=\r
129 >  }\r
130 >  \r
131 >  NOTMUCH_NEW ()\r
132 > -- \r
133 > 1.7.5.4\r
134\r
135 > _______________________________________________\r
136 > notmuch mailing list\r
137 > notmuch@notmuchmail.org\r
138 > http://notmuchmail.org/mailman/listinfo/notmuch\r