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

[PATCH] Fix test failure due to broken sed on Leopard

From
Wincent Colaiuta <win@wincent.com>
Date
Dec 18, 2007, 15:11 UTC
Message-ID
<1197990675-41698-1-git-send-email-win@wincent.com>

The newly-added common-tail-optimization test fails on Leopard because the broken sed implementation bails with a spurious "unterminated substitute pattern" error because of the length of one of the arguments.

So halve the size of the argument (to 1024 - 1, down from the previous 2048 - 1) to get the test passing again.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
---
 t/t4024-diff-optimize-common.sh |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/t/t4024-diff-optimize-common.sh b/t/t4024-diff-optimize-common.sh
index 20fe87b..bbda816 100755
--- a/t/t4024-diff-optimize-common.sh
+++ b/t/t4024-diff-optimize-common.sh
@@ -7,26 +7,26 @@ test_description='common tail optimization'
 z=zzzzzzzz ;# 8
 z="$z$z$z$z$z$z$z$z" ;# 64
 z="$z$z$z$z$z$z$z$z" ;# 512
-z="$z$z$z$z" ;# 2048
-z2047=$(expr "$z" : '.\(.*\)') ; #2047
+z="$z$z" ;# 1024
+z1023=$(expr "$z" : '.\(.*\)') ; #1023
 
 test_expect_success setup '
 
-	echo "a$z2047" >file-a &&
+	echo "a$z1023" >file-a &&
 	echo "b" >file-b &&
-	echo "$z2047" >>file-b &&
-	echo "c$z2047" | tr -d "\012" >file-c &&
+	echo "$z1023" >>file-b &&
+	echo "c$z1023" | tr -d "\012" >file-c &&
 	echo "d" >file-d &&
-	echo "$z2047" | tr -d "\012" >>file-d &&
+	echo "$z1023" | tr -d "\012" >>file-d &&
 
 	git add file-a file-b file-c file-d &&
 
-	echo "A$z2047" >file-a &&
+	echo "A$z1023" >file-a &&
 	echo "B" >file-b &&
-	echo "$z2047" >>file-b &&
-	echo "C$z2047" | tr -d "\012" >file-c &&
+	echo "$z1023" >>file-b &&
+	echo "C$z1023" | tr -d "\012" >file-c &&
 	echo "D" >file-d &&
-	echo "$z2047" | tr -d "\012" >>file-d
+	echo "$z1023" | tr -d "\012" >>file-d
 
 '
 
@@ -61,7 +61,7 @@ EOF
 
 test_expect_success 'diff -U0' '
 
-	git diff -U0 | sed -e "/^index/d" -e "s/$z2047/Z/g" >actual &&
+	git diff -U0 | sed -e "/^index/d" -e "s/$z1023/Z/g" >actual &&
 	diff -u expect actual
 
 '
-- 
1.5.4.rc0.1099.g76fa0-dirty
Message 1 of 1 in “Fix test failure due to broken sed on Leopard”
  1. Fix test failure due to broken sed on LeopardWincent Colaiuta, Dec 18, 2007

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.