# HG changeset patch # User Simon Heimberg # Date 2014-01-16 11:06:49 # Node ID 9e3eb009a4044fa1235a63031dbb084a1e81a7c1 # Parent 4453d08a616ab0c5b7c087e86c5384c70e36affb 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. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -634,9 +634,10 @@ def linematch(el, l): 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):