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

Re: [PATCH 2/3] test: improve rebase -q test

From
Jeff King <peff@peff.net>
Date
Jun 10, 2013, 20:41 UTC
Message-ID
<20130610204123.GB13333@sigill.intra.peff.net>
In-Reply-To
<7vd2rvqgra.fsf@alter.siamese.dyndns.org>
On Sun, Jun 09, 2013 at 11:30:01AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> -- >8 --
> Subject: [PATCH] test: test_output_must_be_empty helper
> 
> There are quite a lot places where an output file is expected to be
> empty, and we fail the test when it is not.  The output from running
> the test script with -i -v can be helped if we showed the unexpected
> contents at that point.
> 
> We could of course do
> 
>     >expected.empty && test_cmp expected.empty actual
> 
> but this is commmon enough to be done with a dedicated helper.

Thanks, I think this improves the readability of the test suite (and its output when there are failures).

You can also do:
  test_cmp /dev/null actual

for the same effect, but I guess the diff is not all that interesting (by definition, it would consist only of added lines, and you are already showing them, so it would not be an improvement).

-Peff
Previous: Junio C HamanoNext: Felipe Contreras
Message 23 of 24 in “Trivial patches”
  1. 0/3 Trivial patchesFelipe Contreras, Jun 7, 2013
  2. 1/3 sequencer: trivial fixFelipe Contreras, Jun 7, 2013
  3. Junio C HamanoJun 7, 2013
  4. Felipe ContrerasJun 7, 2013
  5. 2/3 test: improve rebase -q testFelipe Contreras, Jun 7, 2013
  6. Duy NguyenJun 8, 2013
  7. Felipe ContrerasJun 8, 2013
  8. Junio C HamanoJun 9, 2013
  9. Felipe ContrerasJun 9, 2013
  10. Junio C HamanoJun 9, 2013
  11. Felipe ContrerasJun 9, 2013
  12. Junio C HamanoJun 9, 2013
  13. Felipe ContrerasJun 9, 2013
  14. SZEDER GáborJun 10, 2013
  15. Junio C HamanoJun 10, 2013
  16. Felipe ContrerasJun 10, 2013
  17. SZEDER GáborJun 10, 2013
  18. Johannes SixtJun 10, 2013
  19. SZEDER GáborJun 10, 2013
  20. Junio C HamanoJun 10, 2013
  21. Philip OakleyJun 9, 2013
  22. Junio C HamanoJun 9, 2013
  23. Jeff KingJun 10, 2013
  24. 3/3 submodule: remove unnecessary checkFelipe Contreras, Jun 7, 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.