diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -638,6 +638,8 @@ def linematch(el, l): return rematch(el[:-6], l) if el.endswith(" (glob)\n"): return globmatch(el[:-8], l) + if os.altsep and l.replace('\\', '/') == el: + return '+glob' return False def tsttest(test, wd, options, replacements, env): @@ -791,7 +793,12 @@ def tsttest(test, wd, options, replaceme if pos in expected and expected[pos]: el = expected[pos].pop(0) - if linematch(el, lout): + r = linematch(el, lout) + if isinstance(r, str): + if r == '+glob': + lout = el[:-1] + ' (glob)\n' + r = False + if r: postout.append(" " + el) else: if needescape(lout): diff --git a/tests/test-run-tests.py b/tests/test-run-tests.py --- a/tests/test-run-tests.py +++ b/tests/test-run-tests.py @@ -27,7 +27,10 @@ def lm(expected, output): assert not re.search(r'[^ \w\\/\r\n()*?]', expected + output), \ 'single backslash or unknown char' match = run_tests.linematch(expected, output) - return bool(match) + if isinstance(match, str): + return 'special: ' + match + else: + return bool(match) # do not return match object def wintests(): r"""test matching like running on windows @@ -48,7 +51,7 @@ def wintests(): missing glob >>> lm('/g/c/d/fg\n', '\\g\\c\\d/fg\n') - False + 'special: +glob' restore os.altsep >>> os.altsep = _osaltsep