# HG changeset patch # User Brodie Rao # Date 2010-09-22 21:05:59 # Node ID 4e7dd28db0ddea4aeb912708f8b76030037e3439 # Parent 58885f00b99895a4abb50b1af82da402ff41a6dc tests: ensure regexes match to the end of the string Regular expressions in the test suite are currently written assuming that you need a trailing ".*" to avoid matching to the end. Instead of matching regular expressions using "^pattern", this patch makes matching more restrictive by matching "^pattern$". diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -506,7 +506,8 @@ def tsttest(test, options): # hack to deal with graphlog, which looks like bogus regexes if el.startswith('|'): el = '\\' + el - return re.match(el, l) + # ensure that the regex matches to the end of the string + return re.match(el + r'\Z', l) except re.error: # el is an invalid regex return False