git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/2] send-email: add test for duplicate utf8 name

From
Thomas Rast <trast@inf.ethz.ch>
Date
Jun 20, 2013, 12:48 UTC
Message-ID
<87vc597xtc.fsf@linux-k42r.v.cablecom.net>
In-Reply-To
<20130620124502.GA24172@redhat.com>
"Michael S. Tsirkin" <mst@redhat.com> writes:
Show 16 quoted lines
> On Thu, Jun 20, 2013 at 02:41:37PM +0200, Thomas Rast wrote:
>> "Michael S. Tsirkin" <mst@redhat.com> writes:
>> 
>> > Verify that author name is not duplicated if it matches
>> > sender, even if it is in utf8.
>> 
>> Small nit: if you make two patches out of it, add the tests first with
>> test_expect_failure.  Then flip it to test_expect_success in the actual
>> code change.  That makes it easy to verify that the test actually checks
>> the right thing, and that it was your code change that fixed it.
>
> I did this by reverting 1/2 and rerunning.
>
> But applying in reverse order means bisect can give us
> a setup where some tests fail, I thought it's a
> good idea to avoid that.

That's why you need to test_expect_*failure* in the commit that adds the tests -- essentially saying "I know this is broken!".

Yes, it's a roundabout way. But splitting code and tests in the way you just posted is equally roundabout, while not having the benefit that one can check out the commit at patch 1 and verify that it is indeed broken (showing up as "still have known breakage").

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Michael S. TsirkinNext: Michael S. Tsirkin
Message 5 of 7 in “send-email: sanitize author when writing From line”
  1. 1/2 send-email: sanitize author when writing From lineMichael S. Tsirkin, Jun 20, 2013
  2. 2/2 send-email: add test for duplicate utf8 nameMichael S. Tsirkin, Jun 20, 2013
  3. Thomas RastJun 20, 2013
  4. Michael S. TsirkinJun 20, 2013
  5. Thomas RastJun 20, 2013
  6. Michael S. TsirkinJun 20, 2013
  7. Junio C HamanoJun 20, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.