* [PATCH] annotate.sh: Fix failing test on OS X
@ 2011-05-04 13:36 Arjen Laarhoven
0 siblings, 0 replies; only message in thread
From: Arjen Laarhoven @ 2011-05-04 13:36 UTC (permalink / raw)
To: Junio C Hamano, git
Commit 9b01f0038b63ccdf697b2387f4fcd4b03bd249d5 ('blame: tolerate bogus
e-mail addresses a bit better') introduced a test for obfuscated email
addresses, but it fails on OS X and probably other platforms which don't
use GNU sed. The test breaks because non-GNU seds append a newline to
every line of the file, including the last one, even if it didn't have
one before editing. GNU sed is smart about this (if the last line of
the file doesn't have newline, it is omitted when writing the output).
Also, the text after the sed insert command is expected to start on the
next line after a backslash. GNU sed apparently also understands text
right after the 'i'nsert command.
The fix uses a trick used earlier in the script, which is to remove the
line completely and add it again without a newline using echo and tr.
Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
---
t/annotate-tests.sh | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index abb1885..a4c6146 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -127,7 +127,9 @@ test_expect_success \
test_expect_success \
'an obfuscated email added' \
- 'sed -e "1i No robots allowed" < file > file.new &&
+ 'sed -e "1i\\
+No robots allowed" -e "/^incomplete/d" < file > file.new &&
+ echo "incomplete" | tr -d "\\012" >>file.new &&
mv file.new file &&
GIT_AUTHOR_NAME="E" GIT_AUTHOR_EMAIL="E at test dot git" git commit -a -m "norobots"'
--
1.7.5.278.g5fde9
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-04 13:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-04 13:36 [PATCH] annotate.sh: Fix failing test on OS X Arjen Laarhoven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).