[PATCH] Make t8001-annotate and t8002-blame more portable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These two tests assume that "sed" will not modify the final line of a
stream if it does not end with a newline character.  The assumption is
not true at least for FreeBSD and Solaris 9.  FreeBSD's "sed" appends
a newline character; "sed" in Solaris 9 even removes the incomplete
final line.  This patch makes the test use perl instead.

Signed-off-by: Dennis Stosberg <dennis@xxxxxxxxxxxx>
---
 t/annotate-tests.sh |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 114938c..71d0f30 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -111,9 +111,7 @@ test_expect_success \
 
 test_expect_success \
     'some edit' \
-    'mv file file1 &&
-     sed -e 1d -e "5s/3A/99/" file1 >file &&
-     rm -f file1 &&
+    'perl -pi -e "s/^1A.*\n$//; s/^3A/99/" file &&
     GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
 
 test_expect_success \
-- 
1.4.0
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]