Patchwork tests: add diff color trailing whitespace test

login
register
mail settings
Submitter via Mercurial-devel
Date July 11, 2018, 2:13 p.m.
Message ID <47e87ae492c852e773e1.1531318388@firefly.edlund.dk>
Download mbox | patch
Permalink /patch/32774/
State Superseded
Headers show

Comments

via Mercurial-devel - July 11, 2018, 2:13 p.m.
# HG changeset patch
# User Sune Foldager <cryo@cyanite.org>
# Date 1531318293 -7200
#      Wed Jul 11 16:11:33 2018 +0200
# Node ID 47e87ae492c852e773e19a896d08385eeedd9e35
# Parent  4d5fb4062f0bb159230062701461fa6cab9b539b
tests: add diff color trailing whitespace test

Patch

diff --git a/tests/test-diff-color.t b/tests/test-diff-color.t
--- a/tests/test-diff-color.t
+++ b/tests/test-diff-color.t
@@ -51,6 +51,25 @@  default context
    a
    c
 
+trailing whitespace
+
+  $ sed -i 's/^dd$/dd \r/' 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
+
+  $ sed -i 's/\s*\r$//' a
+
 (check that 'ui.color=yes' match '--color=auto')
 
   $ hg diff --nodates --config ui.formatted=no