run-tests: test each line matching function on its own stable
authorSimon Heimberg <simohe@besonet.ch>
Thu, 16 Jan 2014 12:06:49 +0100
branchstable
changeset 1319 b5ce8c72ddf9
parent 1318 4e600dd12c89
child 1320 b82811d8ce22
run-tests: test each line matching function on its own This has several advantages. * Each match function can return some information to the caller runone (used in the next patch). * It is not checked that the line ends in " (glob)" when rematch() returns false. * And it looks more readable. [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Thu Jan 16 11:26:54 2014 +0100
+++ b/tests/run-tests.py	Thu Jan 16 12:06:49 2014 +0100
@@ -634,9 +634,10 @@
             el = el[:-7].decode('string-escape') + '\n'
         if el == l or os.name == 'nt' and el[:-1] + '\r\n' == l:
             return True
-        if (el.endswith(" (re)\n") and rematch(el[:-6], l) or
-            el.endswith(" (glob)\n") and globmatch(el[:-8], l)):
-            return True
+        if el.endswith(" (re)\n"):
+            return rematch(el[:-6], l)
+        if el.endswith(" (glob)\n"):
+            return globmatch(el[:-8], l)
     return False
 
 def tsttest(test, wd, options, replacements, env):