Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3dcb59

Browse files
committed
Merge pull request micropython#603 from stinos/windows-tests-newline
tests: Fix handling of newlines from expected output files on windows
2 parents 18ceb70 + a4dbc73 commit c3dcb59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/run-tests

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ def run_tests(pyb, tests):
4444
# expected output given by a file, so read that in
4545
with open(test_file_expected, 'rb') as f:
4646
output_expected = f.read()
47+
if os.name == 'nt':
48+
output_expected = output_expected.replace(b'\n', b'\r\n')
4749
else:
48-
# run CPython to work out expeceted output
50+
# run CPython to work out expected output
4951
try:
5052
output_expected = subprocess.check_output([CPYTHON3, '-B', test_file])
5153
except subprocess.CalledProcessError:

0 commit comments

Comments
 (0)