Show More
@@ -638,6 +638,8 b' def linematch(el, l):' | |||||
638 | return rematch(el[:-6], l) |
|
638 | return rematch(el[:-6], l) | |
639 | if el.endswith(" (glob)\n"): |
|
639 | if el.endswith(" (glob)\n"): | |
640 | return globmatch(el[:-8], l) |
|
640 | return globmatch(el[:-8], l) | |
|
641 | if os.altsep and l.replace('\\', '/') == el: | |||
|
642 | return '+glob' | |||
641 | return False |
|
643 | return False | |
642 |
|
644 | |||
643 | def tsttest(test, wd, options, replacements, env): |
|
645 | def tsttest(test, wd, options, replacements, env): | |
@@ -791,7 +793,12 b' def tsttest(test, wd, options, replaceme' | |||||
791 | if pos in expected and expected[pos]: |
|
793 | if pos in expected and expected[pos]: | |
792 | el = expected[pos].pop(0) |
|
794 | el = expected[pos].pop(0) | |
793 |
|
795 | |||
794 |
|
|
796 | r = linematch(el, lout) | |
|
797 | if isinstance(r, str): | |||
|
798 | if r == '+glob': | |||
|
799 | lout = el[:-1] + ' (glob)\n' | |||
|
800 | r = False | |||
|
801 | if r: | |||
795 | postout.append(" " + el) |
|
802 | postout.append(" " + el) | |
796 | else: |
|
803 | else: | |
797 | if needescape(lout): |
|
804 | if needescape(lout): |
@@ -27,7 +27,10 b' def lm(expected, output):' | |||||
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 | |
@@ -48,7 +51,7 b' def wintests():' | |||||
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 |
General Comments 0
You need to be logged in to leave comments.
Login now