Thread (2 messages) 2 messages, 2 authors, 2016-06-15

Re: [PATCH] tests: Introduce test_seq

From: Jeff King <hidden>
Date: 2016-06-15 22:54:25

On Fri, Aug 03, 2012 at 03:48:19PM -0700, Junio C Hamano wrote:
Michał Kiedrowicz [off-list ref] writes:
quoted
Jeff King wrote:

	The seq command is GNU-ism, and is missing at least in older BSD
	releases and their derivatives, not to mention antique
	commercial Unixes.

	We already purged it in b3431bc (Don't use seq in tests, not
	everyone has it, 2007-05-02), but a few new instances have crept
	in. They went unnoticed because they are in scripts that are not
	run by default.

Replace them with test_seq that is implemented with a Perl snippet
(proposed by Jeff).  This is better than inlining this snippet
everywhere it's needed because it's easier to read and it's easier to
change the implementation (e.g. to C) if we ever decide to remove Perl
from the test suite.

Note that test_seq is not a complete replacement for seq(1).  It just
has what we need now.

There are also many places that do `for i in 1 2 3 ...` but I'm not sure
if it's worth converting them to test_seq.  That would introduce running
more processes of Perl.

Signed-off-by: Michał Kiedrowicz <redacted>
---
Thanks; Jeff, ack?
Yeah,

Acked-by: Jeff King <redacted>
quoted
+	"$PERL_PATH" -le 'print for "$ARGV[0]".."$ARGV[1]"' "$first" "$last"
I'd prefer not to have dq around $ARGV[]; is there a reason to have
one around these?
I don't think they accomplish anything, and it is slightly easier to
read without them. I'm fine either way.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help