Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-14 Thread Christian Couder
On Fri, Jun 14, 2019 at 12:22 AM Junio C Hamano wrote: > > Jeff King writes: > > >> > I know there are testing philosophies that go to this level of > >> > white-box testing, but I don't think we usually do in Git. A unit > >> > test of oidmap's externally visible behavior seems like the right >

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-13 Thread Junio C Hamano
Jeff King writes: >> > I know there are testing philosophies that go to this level of >> > white-box testing, but I don't think we usually do in Git. A unit >> > test of oidmap's externally visible behavior seems like the right >> > level to me. >> >> That's a good point... but then why does 't

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-13 Thread Jeff King
On Thu, Jun 13, 2019 at 07:52:36PM +0200, SZEDER Gábor wrote: > > At the point where we are normalizing byte order of the hashes, I have > > to wonder: why do we care about testing the hash value in the first > > place? We care that oidmap can store and retrieve values, and that it > > performs we

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-13 Thread SZEDER Gábor
On Thu, Jun 13, 2019 at 01:19:13PM -0400, Jeff King wrote: > On Sun, Jun 09, 2019 at 11:22:59AM +0200, SZEDER Gábor wrote: > > > So, 'test oidmap' from the previous patch prints the value we want to > > check with: > > > > printf("%u\n", sha1hash(oid.hash)); > > > > First, since object ids i

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-13 Thread Jeff King
On Sun, Jun 09, 2019 at 11:22:59AM +0200, SZEDER Gábor wrote: > So, 'test oidmap' from the previous patch prints the value we want to > check with: > > printf("%u\n", sha1hash(oid.hash)); > > First, since object ids inherently make more sense as hex values, it > would be more appropriate to

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-10 Thread Junio C Hamano
SZEDER Gábor writes: > So, 'test oidmap' from the previous patch prints the value we want to > check with: > > printf("%u\n", sha1hash(oid.hash)); > > First, since object ids inherently make more sense as hex values, it > would be more appropriate to print that hash with the '%x' format > spe

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-09 Thread Christian Couder
On Sun, Jun 9, 2019 at 11:21 PM SZEDER Gábor wrote: > > On Sun, Jun 09, 2019 at 10:24:55PM +0200, Christian Couder wrote: > > On Sun, Jun 9, 2019 at 11:23 AM SZEDER Gábor wrote: > > > > > > New Perl dependencies always make Dscho sad... :) > > > > Yeah, I was not sure how to do it properly in she

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-09 Thread SZEDER Gábor
On Sun, Jun 09, 2019 at 10:24:55PM +0200, Christian Couder wrote: > On Sun, Jun 9, 2019 at 11:23 AM SZEDER Gábor wrote: > > > > On Sun, Jun 09, 2019 at 06:49:06AM +0200, Christian Couder wrote: > > > + > > > +test_oidmap() { > > > + echo "$1" | test-tool oidmap $3 > actual && > > > + echo

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-09 Thread Christian Couder
On Sun, Jun 9, 2019 at 11:23 AM SZEDER Gábor wrote: > > On Sun, Jun 09, 2019 at 06:49:06AM +0200, Christian Couder wrote: > > + > > +test_oidmap() { > > + echo "$1" | test-tool oidmap $3 > actual && > > + echo "$2" > expect && > > Style nit: space between redirection op and filename. Than

Re: [PATCH 2/3] t: add t0016-oidmap.sh

2019-06-09 Thread SZEDER Gábor
On Sun, Jun 09, 2019 at 06:49:06AM +0200, Christian Couder wrote: > From: Christian Couder > > Add actual tests for operations using `struct oidmap` from oidmap.{c,h}. > > Signed-off-by: Christian Couder > --- > t/t0016-oidmap.sh | 100 ++ > 1 file c