tests/run-tests.py
branchstable
changeset 12940 518dd70d1a6e
parent 12934 ea7ad8c3988a
child 12941 b911cb80c671
--- a/tests/run-tests.py	Sat Nov 06 00:31:44 2010 +0100
+++ b/tests/run-tests.py	Mon Nov 08 01:35:40 2010 +0100
@@ -531,29 +531,37 @@
     postout = []
     ret = 0
     for n, l in enumerate(output):
-        if l.startswith(salt):
+        lout, lcmd = l, None
+        if salt in l:
+            lout, lcmd = l.split(salt, 1)
+
+        if lout:
+            if lcmd:
+                lout += ' (no-eol)\n'
+
+            el = None
+            if pos in expected and expected[pos]:
+                el = expected[pos].pop(0)
+
+            if el == lout: # perfect match (fast)
+                postout.append("  " + lout)
+            elif el and el.decode('string-escape') == l:
+                postout.append("  " + el)  # \-escape match
+            elif (el and
+                  (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', lout) or
+                   el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', lout))):
+                postout.append("  " + el) # fallback regex/glob match
+            else:
+                postout.append("  " + lout) # let diff deal with it
+
+        if lcmd:
             # add on last return code
-            ret = int(l.split()[2])
+            ret = int(lcmd.split()[1])
             if ret != 0:
                 postout.append("  [%s]\n" % ret)
             if pos in after:
                 postout += after.pop(pos)
-            pos = int(l.split()[1])
-        else:
-            el = None
-            if pos in expected and expected[pos]:
-                el = expected[pos].pop(0)
-
-            if el == l: # perfect match (fast)
-                postout.append("  " + l)
-            elif el and el.decode('string-escape') == l:
-                postout.append("  " + el)  # \-escape match
-            elif (el and
-                  (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or
-                   el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l))):
-                postout.append("  " + el) # fallback regex/glob match
-            else:
-                postout.append("  " + l) # let diff deal with it
+            pos = int(lcmd.split()[0])
 
     if pos in after:
         postout += after.pop(pos)