[PATCH 2 of 9] heredoctest: do not append extra newline character to continuation line

Yuya Nishihara yuya at tcha.org
Sun Sep 28 09:17:17 CDT 2014


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1411884815 -32400
#      Sun Sep 28 15:13:35 2014 +0900
# Node ID b665907351a96e88e84841fd97b9ddceec9c476e
# Parent  62ea66130006851da1973c55c6bfcb5bfbb7f856
heredoctest: do not append extra newline character to continuation line

Trailing newline characters are kept in lines.

diff --git a/tests/heredoctest.py b/tests/heredoctest.py
--- a/tests/heredoctest.py
+++ b/tests/heredoctest.py
@@ -10,7 +10,7 @@ while lines:
         snippet = l[4:]
         while lines and lines[0].startswith('... '):
             l = lines.pop(0)
-            snippet += "\n" + l[4:]
+            snippet += l[4:]
         c = compile(snippet, '<heredoc>', 'single')
         try:
             exec c in globalvars


More information about the Mercurial-devel mailing list