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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux