tests: don't match blank output lines as regexes in unified tests stable
authorBrodie Rao <brodie@bitheap.org>
Wed, 22 Sep 2010 16:05:59 -0500
branchstable
changeset 798 bca8ef6e70b3
parent 797 f0d8ac85ca21
child 799 c20c12c560dd
tests: don't match blank output lines as regexes in unified tests Currently, the following unified test will pass: $ echo foo A blank output line (a line containing just two spaces) will match any output. The patch modifies the unified test runner to ignore empty strings strings when do regular expression matching. [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Wed Sep 22 16:05:58 2010 -0500
+++ b/tests/run-tests.py	Wed Sep 22 16:05:59 2010 -0500
@@ -530,7 +530,7 @@
 
             if el == l: # perfect match (fast)
                 postout.append("  " + l)
-            elif el and rematch(el, l): # fallback regex match
+            elif el and el[2:] and rematch(el, l): # fallback regex match
                 postout.append("  " + el)
             else: # mismatch - let diff deal with it
                 postout.append("  " + l)