tests/run-tests.py
branchstable
changeset 856 e1a5259b3d03
parent 852 fb1e8925292d
child 857 7060aa668b7f
--- a/tests/run-tests.py	Fri Nov 05 10:01:23 2010 +0000
+++ b/tests/run-tests.py	Sat Nov 06 00:31:44 2010 +0100
@@ -464,6 +464,8 @@
     after = {}
     expected = {}
     for n, l in enumerate(t):
+        if not l.endswith('\n'):
+            l += '\n'
         if l.startswith('  $ '): # commands
             after.setdefault(pos, []).append(l)
             prepos = pos
@@ -480,8 +482,6 @@
             # non-command/result - queue up for merged output
             after.setdefault(pos, []).append(l)
 
-    if script and not script[-1].endswith('\n'):
-        script[-1] = script[-1] + '\n'
     script.append('echo %s %s $?\n' % (salt, n + 1))
 
     fd, name = tempfile.mkstemp(suffix='hg-tst')