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

1 messages from 2007-12-18 to 2007-12-18. Participants: Wincent Colaiuta.
Thread: https://gitlist.dev/t/11342

## Wincent Colaiuta, 2007-12-18 15:11

Subject: [PATCH] Fix test failure due to broken sed on Leopard
Message-ID: <1197990675-41698-1-git-send-email-win@wincent.com>
URL: https://gitlist.dev/e/1197990675-41698-1-git-send-email-win%40wincent.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

```
