Mercurial > public > mercurial-scm > hg-stable
diff tests/test-run-tests.py @ 35390:14fd435763ee
run-tests: suggest a (glob) for os.path.sep mismatches with '\r\n' EOL too
We already do this for lines ending in '\n', such that the test only needs to be
run with --interactive and the changes accepted at the end. But that wasn't
working with list-tree.py output for example, and required manual fixup.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 10 Dec 2017 00:00:36 -0500 |
parents | 2e43c5cd57a7 |
children | dfae14354660 |
line wrap: on
line diff
--- a/tests/test-run-tests.py Sat Dec 09 23:46:44 2017 -0500 +++ b/tests/test-run-tests.py Sun Dec 10 00:00:36 2017 -0500 @@ -54,6 +54,8 @@ enable windows matching on any os >>> _osaltsep = os.altsep >>> os.altsep = True + >>> _osname = os.name + >>> os.name = 'nt' valid match on windows >>> lm(b'g/a*/d (glob)\n', b'g\\abc/d\n') @@ -66,9 +68,12 @@ missing glob >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d/fg\n') 'special: +glob' + >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d\\fg\r\n') + 'special: +glob' restore os.altsep >>> os.altsep = _osaltsep + >>> os.name = _osname """ pass @@ -78,6 +83,8 @@ disable windows matching on any os >>> _osaltsep = os.altsep >>> os.altsep = False + >>> _osname = os.name + >>> os.name = 'nt' backslash does not match slash >>> lm(b'h/a* (glob)\n', b'h\\ab\n') @@ -93,6 +100,7 @@ restore os.altsep >>> os.altsep = _osaltsep + >>> os.name = _osname """ pass