changeset 38660:b07b691d2667

tests: add diff color trailing whitespace test
author Sune Foldager <cryo@cyanite.org>
date Wed, 11 Jul 2018 16:11:33 +0200
parents cc76692f401d
children 8ac0c9cd4c48
files tests/test-diff-color.t
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-diff-color.t	Wed Jul 11 13:40:50 2018 -0400
+++ b/tests/test-diff-color.t	Wed Jul 11 16:11:33 2018 +0200
@@ -51,6 +51,27 @@
    a
    c
 
+trailing whitespace
+
+  $ cp a a.orig
+  $ sed 's/^dd$/dd \r/' a >a.new
+  $ mv a.new a
+  $ hg diff --nodates
+  \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
+  \x1b[0;31;1m--- a/a\x1b[0m (esc)
+  \x1b[0;32;1m+++ b/a\x1b[0m (esc)
+  \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
+   c
+   a
+   a
+  \x1b[0;31m-b\x1b[0m (esc)
+  \x1b[0;32m+dd\x1b[0m\x1b[0;1;41m \x1b[0m\r (esc)
+   a
+   a
+   c
+
+  $ mv a.orig a
+
 (check that 'ui.color=yes' match '--color=auto')
 
   $ hg diff --nodates --config ui.formatted=no