Subject: Re: [PATCH 3/3] test-lib.sh: support -x option for shell-tracing

From: Jeff King <[email-masked]>
Date: Fri, 10 Oct 2014 02:27:22 -0400

On Fri, Oct 10, 2014 at 02:13:55AM -0400, Jeff King wrote:

> +	-x)
> +		test_eval_start_='set -x'
> [...]
> +	eval "$test_eval_start_ $*"
> +}

Hmph. I had originally intended to make this "set -x;" with a semicolon,
to keep it split from $*. But I forgot to, and much to my surprise, all
of the tests still passed. I think that is because each of the tests
is one of:

  1. Long, in which case we split the commands into their own line,
     like:

        test_expect_success 'foo' '
		some command
	'

     and the leading newline serves as the separator.

or

  2. Short, like:

       test_expect_success 'foo' 'bar'

     in which case we did not run the test at all, but merely set $1 to
     'bar', which of course succeeded. Whoops!

Still, I'm surprised that nothing failed due to case 2.  I'll send a
re-roll in a moment.

-Peff