git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t1402: work around shell quoting issue on NetBSD

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Jan 8, 2013, 21:13 UTC
Message-ID
<50EC8BE7.2010508@lsrfire.ath.cx>
In-Reply-To
<7vr4lvcstt.fsf@alter.siamese.dyndns.org>
Am 08.01.2013 21:39, schrieb Junio C Hamano:
Show 22 quoted lines
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>> 	# on NetBSD with /bin/sh
>> 	$ a() { echo $#-$1-$2; }
>> 	$ t="x"; a "${t:+$t}"
>> 	1-x-
>> 	$ t="x y"; a "${t:+$t}"
>> 	2-x-y
>> 	$ t="x y"; a "${t:+x y}"
>> 	1-x y-
>>
>> 	# and with bash
>> 	$ t="x y"; a "${t:+$t}"
>> 	1-x y-
>> 	$ t="x y"; a "${t:+x y}"
>> 	1-x y-
>>
>> This may be a bug in the shell, but here's a simple workaround: Construct
>> the description string first and store it in a variable, and then use
>> that to call test_expect_success().
>
> Interesting.  I notice that t0008 added recently to 'pu' has the
> same construct.

A quick check shows that subtests 64-68 and 89-93 of t0008 fail for me on Debian (10 in total) and subtests 64 and 89 fail on NetBSD (2 in total). Unlike t1402 they don't report "bug in the test script".

t0008 only uses ${:+} substitution on variables that don't contain spaces. With the test changed to store the description in a variable first I still get the same 2 failures.

There must be something else going on here. The different results are interesting, especially the higher number of failures on Debian.

René
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 11 in “t1402: work around shell quoting issue on NetBSD”
  1. t1402: work around shell quoting issue on NetBSDRené Scharfe, Jan 8, 2013
  2. Junio C HamanoJan 8, 2013
  3. René ScharfeJan 8, 2013
  4. Junio C HamanoJan 8, 2013
  5. t0008: avoid brace expansionRené Scharfe, Jan 9, 2013
  6. Adam SpiersJan 9, 2013
  7. Junio C HamanoJan 10, 2013
  8. Adam SpiersJan 10, 2013
  9. René ScharfeJan 10, 2013
  10. Greg TroxelJan 9, 2013
  11. Greg TroxelJan 9, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.