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

Re: [PATCH 2/2] tests: fix diff order arguments in test_cmp

From
Stefan Beller <sbeller@google.com>
Date
Oct 6, 2017, 22:10 UTC
Message-ID
<CAGZ79kZhF=-baqPPqTCsbdyybOTV+SdvTqYiRbvsvB1epqpkZQ@mail.gmail.com>
In-Reply-To
<20171006220101.GZ19555@aiede.mtv.corp.google.com>
On Fri, Oct 6, 2017 at 3:01 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 16 quoted lines
> Stefan Beller wrote:
>
>> Fix the argument order for test_cmp. When given the expected
>> result first the diff shows the actual output with '+' and the
>> expectation with '-', which is the convention for our tests.
>>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> ---
>
> Yes, this should make the output from failing tests easier to take in
> at a glance.
>
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
>
> How did you find these?  E.g. is there a grep pattern that reviewers
> can use to repeat your results?
The grunge work was done via scrolling through
git -C t grep test_cmp

However it occurred to me that checking for the completeness could be done via

  git -C t grep test_cmp | \
    awk '{$1=""; print }  | \ # remove file name from output
    sort | uniq

There are some cases that are still pretty obvious what the "actual" and the "expect" is, but they are not included in this patch as the code (and file names) looked hairy.

Previous: Jonathan NiederNext: Junio C Hamano
Message 4 of 11 in “tests: use shell negation instead of test_must_fail for test_cmp”
  1. 1/2 tests: use shell negation instead of test_must_fail for test_cmpStefan Beller, Oct 6, 2017
  2. 2/2 tests: fix diff order arguments in test_cmpStefan Beller, Oct 6, 2017
  3. Jonathan NiederOct 6, 2017
  4. Stefan BellerOct 6, 2017
  5. Junio C HamanoOct 7, 2017
  6. Junio C HamanoOct 7, 2017
  7. Jeff KingOct 6, 2017
  8. Stefan BellerOct 6, 2017
  9. Jonathan NiederOct 6, 2017
  10. Junio C HamanoOct 7, 2017
  11. Jonathan NiederOct 6, 2017

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.