comparison tests/test-diff-color.t @ 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 b07b691d2667
children ddc1da134772
comparison
equal deleted inserted replaced
38751:71d6886d27cf 38752:8623a6c96998
52 c 52 c
53 53
54 trailing whitespace 54 trailing whitespace
55 55
56 $ cp a a.orig 56 $ cp a a.orig
57 $ sed 's/^dd$/dd \r/' a >a.new 57 >>> with open('a', 'rb') as f:
58 $ mv a.new a 58 ... data = f.read()
59 >>> with open('a', 'wb') as f:
60 ... f.write(data.replace('dd', 'dd \r'))
59 $ hg diff --nodates 61 $ hg diff --nodates
60 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc) 62 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
61 \x1b[0;31;1m--- a/a\x1b[0m (esc) 63 \x1b[0;31;1m--- a/a\x1b[0m (esc)
62 \x1b[0;32;1m+++ b/a\x1b[0m (esc) 64 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
63 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc) 65 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)