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

Re: Git Test Coverage Report (Thursday, May 30th)

From
Derrick Stolee <stolee@gmail.com>
Date
Jun 5, 2019, 00:57 UTC
Message-ID
<9018d6bb-3bc1-824d-e61e-e37bb1587640@gmail.com>
In-Reply-To
<09bc8c7a-bab5-7cdb-75dc-f7c45a4dbaf8@google.com>
On 6/4/2019 4:41 PM, Barret Rhoden wrote:
> Hi -
> 
> On 6/4/19 12:38 PM, Barret Rhoden wrote:
> However, the only thing we are really testing is that git blame didn't crash. 
This would not be enough.
> There is no detectable change to the output.  AFAIK, blame_coalesce() is a performance enhancement.

Thank you for stating that the output didn't change. I tested this locally, and did see that the behavior was identical.

I think you should just make the test be complete by checking a post-condition. Please see the inserted lines below (which _should_ work, I haven't actually ran this in the test suite).

Show 7 quoted lines
> +test_expect_success 'blame coalesce' '
> +    cat >giraffe <<-\EOF &&
> +    ABC
> +    DEF
> +    EOF
> +    git add giraffe &&
> +    git commit -m "original file" &&
oid=$(git rev-parse HEAD) &&
Show 16 quoted lines
> +   
> +    cat >giraffe <<-\EOF &&
> +    ABC
> +    XXX
> +    DEF
> +    EOF
> +    git add giraffe &&
> +    git commit -m "interior XXX line" &&
> +   
> +    cat >giraffe <<-\EOF &&
> +    ABC
> +    DEF
> +    EOF
> +    git add giraffe &&
> +    git commit -m "same contents as original" &&
> +

cat >expect <<-\EOF && ^$oid 1) ABC ^$oid 2) DEF EOF git -c core.abbrev=40 blame -s giraffe >actual && test_cmp expect actual

> +'
> +
>  test_done
> 
Previous: Barret RhodenNext: Barret Rhoden
Message 10 of 11 in “Git Test Coverage Report (Thursday, May 30th)”
  1. Derrick StoleeMay 30, 2019
  2. Derrick StoleeMay 30, 2019
  3. Derrick StoleeMay 31, 2019
  4. Johannes SchindelinMay 31, 2019
  5. Michael PlatingsJun 1, 2019
  6. Barret RhodenJun 3, 2019
  7. Derrick StoleeJun 3, 2019
  8. Barret RhodenJun 4, 2019
  9. Barret RhodenJun 4, 2019
  10. Derrick StoleeJun 5, 2019
  11. Barret RhodenJun 10, 2019

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.