# HG changeset patch # User Matt Harbison <matt_harbi...@yahoo.com> # Date 1512882036 18000 # Sun Dec 10 00:00:36 2017 -0500 # Node ID e1119050f15e2169ac766e6a69eeab70729e9e40 # Parent d607e334441c01020660497186aa11945bba670e 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. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1610,8 +1610,10 @@ if l.endswith(b" (glob)\n"): l = l[:-8] + b"\n" return TTest.globmatch(el[:-8], l) or retry - if os.altsep and l.replace(b'\\', b'/') == el: - return b'+glob' + if os.altsep: + _l = l.replace(b'\\', b'/') + if el == _l or os.name == 'nt' and el[:-1] + b'\r\n' == _l: + return b'+glob' return retry @staticmethod 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 @@ -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 _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel