Re: [PATCH 1/4] clone: add tests for --template and some disallowed option pairs

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

 



On Fri, Sep 11, 2020 at 02:57:11PM -0400, Derrick Stolee wrote:

> > diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
> > index e69427f881..d20a78f84b 100755
> > --- a/t/t5606-clone-options.sh
> > +++ b/t/t5606-clone-options.sh
> > @@ -19,6 +19,50 @@ test_expect_success 'clone -o' '
> >  
> >  '
> >  
> > +test_expect_success 'disallows --bare with --origin' '
> > +
> > +	test_expect_code 128 git clone -o foo --bare parent clone-bare-o 2>err &&
> > +	test_debug "cat err" &&
> > +	test_i18ngrep "\-\-bare and --origin foo options are incompatible" err
> > +
> > +'
> 
> It seems that all of your tests have an extraneous newline
> at the end.

And the beginning. :)

It's matching the surrounding test, which are written in an older
inconsistent style. I think it's OK to match them, but cleaning them
would be welcome, too.

While I'm looking at this hunk, two other things:

 - do we really care about code 128, or just failure? test_must_fail
   might be a better choice

 - I didn't even know we had test_debug. ;) The last time somebody added
   a call to it was in 2012. I think it's being used as intended here,
   but I'm not sure that the clutter to the test is worth it (we have
   other tools like "-i" to stop at the right spot and let you inspect
   the broken state).

 - the backslash escapes confused me for a moment. I guess they are
   trying to hide the dashes from grep's option parser. That's OK,
   though I'd have probably just started with "bare" since we're
   matching a substring anyway. I think you could also use "-e" with
   test_i18ngrep.

-Peff



[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