# HG changeset patch # User Matt Harbison # Date 2017-12-10 05:16:11 # Node ID dfae14354660d240517a37cdeb785dd587d343fa # Parent 14fd435763eed6353ba0eb0ae0ec628403c143d5 run-tests: accept '\' vs '/' path differences without '(glob)' Having to constantly adjust these is a hassle. It's easy for this to slip by when not testing on Windows, and then when it happens on stable, the tests fail for the next 3 months if we follow the rules for stable. This works the same way the EOL differences are ignored, namely to adjust on the fly and recheck on Windows. I can't think of any situation where there would be a '\' on Windows, a '/' elsewhere, and the '/' should be considered a failure on Windows. This fixes the obvious output problems where (glob) is missing. Without this, test-alias.t, test-remotenames.t and test-largefiles-misc.t are failing. The flip side (not handled by this) is the case where an unnecessary glob is present. There seems to be two separate behaviors. cf300c1ad7bf is an example of where the test has been autocorrecting (with output differences), and d4ec69ff652a is an example where the test fails and reports 'no result code from test'. Hopefully those cases will become even more rare if people don't need to guess at when a glob is needed for a Windows path. It's probably unreasonable to submit a single patch that wipes out all of the (glob) instances that were only used to hide path differences, given the churn from other contributors. Since their presence isn't harming the tests, these can be removed through attrition. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1451,10 +1451,7 @@ class TTest(Test): r = self.linematch(el, lout) if isinstance(r, str): - if r == '+glob': - lout = el[:-1] + ' (glob)\n' - r = '' # Warn only this line. - elif r == '-glob': + if r == '-glob': lout = ''.join(el.rsplit(' (glob)', 1)) r = '' # Warn only this line. elif r == "retry": @@ -1613,7 +1610,7 @@ class TTest(Test): 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 True 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 @@ -67,9 +67,9 @@ def wintests(): missing glob >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d/fg\n') - 'special: +glob' + True >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d\\fg\r\n') - 'special: +glob' + True restore os.altsep >>> os.altsep = _osaltsep