Show More
@@ -578,6 +578,8 b' def pytest(test, wd, options, replacemen' | |||||
578 | py3kswitch = options.py3k_warnings and ' -3' or '' |
|
578 | py3kswitch = options.py3k_warnings and ' -3' or '' | |
579 | cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test) |
|
579 | cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test) | |
580 | vlog("# Running", cmd) |
|
580 | vlog("# Running", cmd) | |
|
581 | if os.name == 'nt': | |||
|
582 | replacements.append((r'\r\n', '\n')) | |||
581 | return run(cmd, wd, options, replacements, env) |
|
583 | return run(cmd, wd, options, replacements, env) | |
582 |
|
584 | |||
583 | needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search |
|
585 | needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search | |
@@ -592,6 +594,8 b' def stringescape(s):' | |||||
592 | def rematch(el, l): |
|
594 | def rematch(el, l): | |
593 | try: |
|
595 | try: | |
594 | # use \Z to ensure that the regex matches to the end of the string |
|
596 | # use \Z to ensure that the regex matches to the end of the string | |
|
597 | if os.name == 'nt': | |||
|
598 | return re.match(el + r'\r?\n\Z', l) | |||
595 | return re.match(el + r'\n\Z', l) |
|
599 | return re.match(el + r'\n\Z', l) | |
596 | except re.error: |
|
600 | except re.error: | |
597 | # el is an invalid regex |
|
601 | # el is an invalid regex | |
@@ -629,6 +633,8 b' def linematch(el, l):' | |||||
629 | if el: |
|
633 | if el: | |
630 | if el.endswith(" (esc)\n"): |
|
634 | if el.endswith(" (esc)\n"): | |
631 | el = el[:-7].decode('string-escape') + '\n' |
|
635 | el = el[:-7].decode('string-escape') + '\n' | |
|
636 | if el == l or os.name == 'nt' and el[:-1] + '\r\n' == l: | |||
|
637 | return True | |||
632 | if (el.endswith(" (re)\n") and rematch(el[:-6], l) or |
|
638 | if (el.endswith(" (re)\n") and rematch(el[:-6], l) or | |
633 | el.endswith(" (glob)\n") and globmatch(el[:-8], l)): |
|
639 | el.endswith(" (glob)\n") and globmatch(el[:-8], l)): | |
634 | return True |
|
640 | return True | |
@@ -947,7 +953,6 b' def runone(options, test, count):' | |||||
947 | c.isdigit() and c or |
|
953 | c.isdigit() and c or | |
948 | '\\' + c |
|
954 | '\\' + c | |
949 | for c in testtmp), '$TESTTMP')) |
|
955 | for c in testtmp), '$TESTTMP')) | |
950 | replacements.append((r'\r\n', '\n')) |
|
|||
951 | else: |
|
956 | else: | |
952 | replacements.append((re.escape(testtmp), '$TESTTMP')) |
|
957 | replacements.append((re.escape(testtmp), '$TESTTMP')) | |
953 |
|
958 |
General Comments 0
You need to be logged in to leave comments.
Login now