tests/test-run-tests.py
changeset 20273 d9d6cbbeef0d
parent 20271 4453d08a616a
child 20274 7a259dfe24f7
equal deleted inserted replaced
20272:9e3eb009a404 20273:d9d6cbbeef0d
    25     """
    25     """
    26     assert expected.endswith('\n') and output.endswith('\n'), 'missing newline'
    26     assert expected.endswith('\n') and output.endswith('\n'), 'missing newline'
    27     assert not re.search(r'[^ \w\\/\r\n()*?]', expected + output), \
    27     assert not re.search(r'[^ \w\\/\r\n()*?]', expected + output), \
    28            'single backslash or unknown char'
    28            'single backslash or unknown char'
    29     match = run_tests.linematch(expected, output)
    29     match = run_tests.linematch(expected, output)
    30     return bool(match)
    30     if isinstance(match, str):
       
    31         return 'special: ' + match
       
    32     else:
       
    33         return bool(match) # do not return match object
    31 
    34 
    32 def wintests():
    35 def wintests():
    33     r"""test matching like running on windows
    36     r"""test matching like running on windows
    34 
    37 
    35     enable windows matching on any os
    38     enable windows matching on any os
    46         Info, unnecessary glob: g/b (glob)
    49         Info, unnecessary glob: g/b (glob)
    47         True
    50         True
    48 
    51 
    49     missing glob
    52     missing glob
    50         >>> lm('/g/c/d/fg\n', '\\g\\c\\d/fg\n')
    53         >>> lm('/g/c/d/fg\n', '\\g\\c\\d/fg\n')
    51         False
    54         'special: +glob'
    52 
    55 
    53     restore os.altsep
    56     restore os.altsep
    54         >>> os.altsep = _osaltsep
    57         >>> os.altsep = _osaltsep
    55     """
    58     """
    56     os.altsep # for pyflakes, because it does not see os in the doctest
    59     os.altsep # for pyflakes, because it does not see os in the doctest