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

[PATCH] perf: fix test_export with SHELL=zsh

From
René Scharfe <l.s.r@web.de>
Date
Oct 2, 2021, 09:40 UTC
Message-ID
<8b70d04f-0ad1-6e68-f5a2-2d8ec3bb98ea@web.de>

Unlike other shells, zsh doesn't do word-splitting on variables. This is documented in https://zsh.sourceforge.io/FAQ/zshfaq03.html#31. That breaks the perf function test_export because it uses a space-separated variable as a poor man's array, and as a consequence p0000 fails with "not ok 3 - test_export works". Pass the value through an unquoted command substitution to force word-splitting even in zsh.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 t/perf/perf-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index f5ed092ee5..f74cfd35d6 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -165,7 +165,7 @@ test_export () {
 '"$1"'
 ret=$?
 needles=
-for v in $test_export_
+for v in $(echo "$test_export_")
 do
 	needles="$needles;s/^$v=/export $v=/p"
 done
--
2.33.0
Next: Johannes Altmanninger
Message 1 of 7 in “perf: fix test_export with SHELL=zsh”
  1. perf: fix test_export with SHELL=zshRené Scharfe, Oct 2, 2021
  2. Johannes AltmanningerOct 2, 2021
  3. t/perf: do not run tests in user's $SHELLJohannes Altmanninger, Oct 7, 2021
  4. Jeff KingOct 8, 2021
  5. Johannes AltmanningerOct 8, 2021
  6. Jeff KingOct 8, 2021
  7. brian m. carlsonOct 2, 2021

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.