tests: don't match blank output lines as regexes in unified tests
authorBrodie Rao <brodie@bitheap.org>
Wed, 22 Sep 2010 16:05:59 -0500
changeset 12373 58885f00b998
parent 12372 5163e3c8aa52
child 12374 4e7dd28db0dd
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.
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)