diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -606,7 +606,7 @@ def globmatch(el, l): if el + '\n' == l: if os.altsep: # matching on "/" is not needed for this line - log("\nInfo, unnecessary glob: %s (glob)" % el) + return '-glob' return True i, n = 0, len(el) res = '' @@ -797,7 +797,14 @@ def tsttest(test, wd, options, replaceme if isinstance(r, str): if r == '+glob': lout = el[:-1] + ' (glob)\n' - r = False + r = False + elif r == '-glob': + log('\ninfo, unnecessary glob in %s (after line %d):' + ' %s (glob)\n' % (test, pos, el[-1])) + r = True # pass on unnecessary glob + else: + log('\ninfo, unknown linematch result: %r\n' % r) + r = False if r: postout.append(" " + el) else: 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 @@ -45,9 +45,7 @@ def wintests(): direct matching, glob unnecessary >>> lm('g/b (glob)\n', 'g/b\n') - - Info, unnecessary glob: g/b (glob) - True + 'special: -glob' missing glob >>> lm('/g/c/d/fg\n', '\\g\\c\\d/fg\n')