Hi Torsten,

On Sat, 9 Dec 2017, Torsten Bögershausen wrote:

> On Thu, Dec 07, 2017 at 04:33:12PM -0500, Todd Zullinger wrote:
> > Jeff Hostetler wrote:
> > >I'm looking at t5616 now on my mac.
> > >Looks like the MAC doesn't like my line counting in the tests.
> > >I'll fix in my next version.
> > 
> []
> >             | sort >expect_2.oids &&
> > -   test "$(wc -l <expect_2.oids)" = "8" &&
> > +   test_line_count = 8 expect_2.oids &&
> >     git -C src blame master -- file.1.txt >expect.blame
> > '
> 
> 
> The problem seems to be the '"' around wc, this would work:
> test $(wc -l <expect_2.oids) = "8" &&
> 
> 
> What do you guys think a about a lint test like this:
> 
> diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
> index 03dc9d2852..9ebf65c26f 100755
> --- a/t/check-non-portable-shell.pl
> +++ b/t/check-non-portable-shell.pl
> @@ -21,6 +21,7 @@ while (<>) {
>       /^\s*declare\s+/ and err 'arrays/declare not portable';
>       /^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
>       /\btest\s+[^=]*==/ and err '"test a == b" is not portable (please use 
> =)';
> +     /\bwc -l.*"\s*=/ and err '`"$(wc -l)"` is not portable, please use 
> `$(wc -l)`';
>       /\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable 
> (please use FOO=bar && expo

Please suggest `test_line_count` instead.

Ciao,
Dscho

Reply via email to