Patchwork D1159: run-tests: move newline out of colorized message

login
register
mail settings
Submitter phabricator
Date Oct. 18, 2017, 12:47 p.m.
Message ID <7f093fe79f12cb99baae5ff44319e859@localhost.localdomain>
Download mbox | patch
Permalink /patch/25164/
State Not Applicable
Headers show

Comments

phabricator - Oct. 18, 2017, 12:47 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8bce3e51b101: run-tests: move newline out of colorized message (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1159?vs=2934&id=2971

REVISION DETAIL
  https://phab.mercurial-scm.org/D1159

AFFECTED FILES
  tests/run-tests.py
  tests/test-run-tests.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers, mbthomas
Cc: mercurial-devel

Patch

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -131,6 +131,7 @@ 
   \x1b[38;5;34m+  bar*baz (glob)\x1b[39m (esc)
      bar*bad (glob)
   \x1b[38;5;124m-  bar*baz (glob)\x1b[39m (esc)
+  
   \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc)
   !
   \x1b[38;5;88mFailed \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m: output changed\x1b[39m (esc)
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1663,7 +1663,9 @@ 
                     self.stream.write('t')
                 else:
                     if not self._options.nodiff:
-                        formatted = '\nERROR: %s output changed\n' % test
+                        self.stream.write('\n')
+                        # Exclude the '\n' from highlighting to lex correctly
+                        formatted = 'ERROR: %s output changed\n' % test
                         self.stream.write(highlightmsg(formatted, self.color))
                     self.stream.write('!')