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

Re: [RFC/PATCH 2/3] mailinfo: correct malformed test example

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Sep 17, 2016, 00:31 UTC
Message-ID
<3a27685f-a53b-03a7-93d5-0492638faf51@google.com>
In-Reply-To
<xmqqbmznihe0.fsf@gitster.mtv.corp.google.com>
On 09/16/2016 03:55 PM, Junio C Hamano wrote:
Show 9 quoted lines
> Hmph, these:
>
>  t/t5100/info0008--no-inbody-headers  | 5 +++++
>  t/t5100/msg0008--no-inbody-headers   | 6 ++++++
>  t/t5100/msg0015--no-inbody-headers   | 1 +
>
> have --no-inbody-headers in their names; wouldn't that an indication
> that they are expected output when mailinfo is run while in-body
> header feature disabled?

Yes, that's correct (they are the test data for when the in-body header feature is disabled).

> I would have expected that it would make more sense to make no
> change to sample.mbox and have updated expectation to outputs in the
> case where in-body header feature is enabled.
The sample.mbox file contains the following:
   From nobody Mon Sep 17 00:00:00 2001
   From: A U Thor <a.u.thor@example.com>
   Subject: check bogus body header (from)
   Date: Fri, 9 Jun 2006 00:44:16 -0700
   From: bogosity
     - a list
     - of stuff

Unchanged, the subsequent patch would break this test because it would interpret that as a multi-line "From" in-body header when in-body headers are *not* disabled.

Besides changing sample.mbox, the other way to make sure that this test passes is to suppress the test when in-body headers are *not* disabled, but looking at t5100* (directory and script), it seemed more straightforward to modify sample.mbox.

The patch I sent added a blank line after "From: bogosity", but removing the spaces before "- a list" and "- of stuff" would work too.

> To make sure this new feature will not break in the future, we would
> want a brand new message with a folded in-body header added to the
> sample.mbox, and see how it is parsed by mailinfo with in-body
> header feature enabled (and disabled).

OK, I'll add this test. (The subsequent patch already has the brand new message, but not the test where in-body headers are disabled.)

Previous: Junio C HamanoNext: Junio C Hamano
Message 14 of 24 in “sequencer: support folding in rfc2822 footer”
  1. sequencer: support folding in rfc2822 footerJonathan Tan, Sep 2, 2016
  2. Junio C HamanoSep 3, 2016
  3. Jonathan TanSep 6, 2016
  4. Jonathan TanSep 6, 2016
  5. Jeff KingSep 7, 2016
  6. 0/3 handle multiline in-body headersJonathan Tan, Sep 16, 2016
  7. 1/3 mailinfo: refactor commit message processingJonathan Tan, Sep 16, 2016
  8. Junio C HamanoSep 16, 2016
  9. Jeff KingSep 16, 2016
  10. 2/3 mailinfo: correct malformed test exampleJonathan Tan, Sep 16, 2016
  11. Junio C HamanoSep 16, 2016
  12. Jonathan TanSep 16, 2016
  13. Junio C HamanoSep 16, 2016
  14. Jonathan TanSep 17, 2016
  15. Junio C HamanoSep 17, 2016
  16. 3/3 mailinfo: handle in-body header continuationsJonathan Tan, Sep 16, 2016
  17. Junio C HamanoSep 16, 2016
  18. Jonathan TanSep 16, 2016
  19. Junio C HamanoSep 16, 2016
  20. Jonathan TanSep 16, 2016
  21. Junio C HamanoSep 16, 2016
  22. Jonathan TanSep 17, 2016
  23. Jeff KingSep 16, 2016
  24. Junio C HamanoSep 16, 2016

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.