tests: quickly check if the glob line already matches the output
authorSimon Heimberg <simohe@besonet.ch>
Wed, 13 Feb 2013 21:58:52 +0100
changeset 18680 15711d9d8b2c
parent 18678 423eee0b0b14
child 18681 7591ed29e824
tests: quickly check if the glob line already matches the output This happens when a path with "/" as only glob char is matched on a non windows platform. (Currently one third of all glob matches.) The slowdown on windows and the speedup on other os are neglectable.
tests/run-tests.py
--- a/tests/run-tests.py	Wed Feb 13 12:20:10 2013 -0800
+++ b/tests/run-tests.py	Wed Feb 13 21:58:52 2013 +0100
@@ -541,6 +541,8 @@
 def globmatch(el, l):
     # The only supported special characters are * and ? plus / which also
     # matches \ on windows. Escaping of these caracters is supported.
+    if el + '\n' == l:
+        return True
     i, n = 0, len(el)
     res = ''
     while i < n: