Re: Git Test Coverage Report (Thursday, May 30th)
From: Derrick Stolee <hidden>
Date: 2019-06-05 00:57:18
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).
+test_expect_success 'blame coalesce' ' + cat >giraffe <<-\EOF && + ABC + DEF + EOF + git add giraffe && + git commit -m "original file" &&
oid=$(git rev-parse HEAD) &&
+ + 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