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.
--- a/tests/run-tests.py Sun Dec 10 00:00:36 2017 -0500
+++ b/tests/run-tests.py Sun Dec 10 00:16:11 2017 -0500
@@ -1451,10 +1451,7 @@
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 @@
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
--- a/tests/test-run-tests.py Sun Dec 10 00:00:36 2017 -0500
+++ b/tests/test-run-tests.py Sun Dec 10 00:16:11 2017 -0500
@@ -67,9 +67,9 @@
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