changeset 38752:8623a6c96998 stable

tests: use inline Python instead of sed to add trailing whitespace The sed invocation was failing on OS X and FreeBSD. I'm far too lazy to diagnose that, so just use some inline Python to fix the build.
author Augie Fackler <augie@google.com>
date Mon, 30 Jul 2018 10:18:29 -0400
parents 71d6886d27cf
children e06a10d3b926
files tests/test-diff-color.t
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-diff-color.t	Mon Jul 30 09:50:32 2018 -0400
+++ b/tests/test-diff-color.t	Mon Jul 30 10:18:29 2018 -0400
@@ -54,8 +54,10 @@
 trailing whitespace
 
   $ cp a a.orig
-  $ sed 's/^dd$/dd \r/' a >a.new
-  $ mv a.new a
+  >>> with open('a', 'rb') as f:
+  ...     data = f.read()
+  >>> with open('a', 'wb') as f:
+  ...     f.write(data.replace('dd', 'dd \r'))
   $ hg diff --nodates
   \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
   \x1b[0;31;1m--- a/a\x1b[0m (esc)