DORMANTno replies

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

From: Wincent Colaiuta <hidden>
Date: 2016-06-15 22:44:00
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help