comparison tests/test-run-tests.py @ 41759:aaad36b88298

cleanup: use () to wrap long lines instead of \ This is a little less brittle, and often helps indentation. In a surprising number of cases the entire cleanup was deleting the \, as the expression was *already* parenthesized in a workable way. Differential Revision: https://phab.mercurial-scm.org/D5993
author Augie Fackler <augie@google.com>
date Wed, 20 Feb 2019 19:28:51 -0500
parents f83600efa1ca
children 2372284d9457
comparison
equal deleted inserted replaced
41758:15d3facfa40a 41759:aaad36b88298
35 ... except AssertionError as ex: prn(ex) 35 ... except AssertionError as ex: prn(ex)
36 single backslash or unknown char 36 single backslash or unknown char
37 """ 37 """
38 assert (expected.endswith(b'\n') 38 assert (expected.endswith(b'\n')
39 and output.endswith(b'\n')), 'missing newline' 39 and output.endswith(b'\n')), 'missing newline'
40 assert not re.search(br'[^ \w\\/\r\n()*?]', expected + output), \ 40 assert not re.search(br'[^ \w\\/\r\n()*?]', expected + output), (
41 b'single backslash or unknown char' 41 b'single backslash or unknown char')
42 test = run_tests.TTest(b'test-run-test.t', b'.', b'.') 42 test = run_tests.TTest(b'test-run-test.t', b'.', b'.')
43 match, exact = test.linematch(expected, output) 43 match, exact = test.linematch(expected, output)
44 if isinstance(match, str): 44 if isinstance(match, str):
45 return 'special: ' + match 45 return 'special: ' + match
46 elif isinstance(match, bytes): 46 elif isinstance(match, bytes):