mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-10 13:24:18 +00:00
Fix mixed-line-ending tests on windows
This commit is contained in:
parent
fc8a5b27e9
commit
47c4d9ebed
1 changed files with 4 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ TESTS_FIX_AUTO = (
|
||||||
)
|
)
|
||||||
def test_mixed_line_ending_fix_auto(input_s, expected_retval, output, tmpdir):
|
def test_mixed_line_ending_fix_auto(input_s, expected_retval, output, tmpdir):
|
||||||
path = tmpdir.join('file.txt')
|
path = tmpdir.join('file.txt')
|
||||||
path.write(input_s)
|
path.write_binary(input_s)
|
||||||
ret = mixed_line_ending(('--fix=auto', path.strpath))
|
ret = mixed_line_ending(('--fix=auto', path.strpath))
|
||||||
|
|
||||||
assert ret == expected_retval
|
assert ret == expected_retval
|
||||||
|
|
@ -69,7 +69,7 @@ TESTS_NO_FIX = (
|
||||||
)
|
)
|
||||||
def test_detect_mixed_line_ending(input_s, expected_retval, output, tmpdir):
|
def test_detect_mixed_line_ending(input_s, expected_retval, output, tmpdir):
|
||||||
path = tmpdir.join('file.txt')
|
path = tmpdir.join('file.txt')
|
||||||
path.write(input_s)
|
path.write_binary(input_s)
|
||||||
ret = mixed_line_ending(('--fix=no', path.strpath))
|
ret = mixed_line_ending(('--fix=no', path.strpath))
|
||||||
|
|
||||||
assert ret == expected_retval
|
assert ret == expected_retval
|
||||||
|
|
@ -108,7 +108,7 @@ def test_mixed_line_ending_fix_force_lf(
|
||||||
tmpdir,
|
tmpdir,
|
||||||
):
|
):
|
||||||
path = tmpdir.join('file.txt')
|
path = tmpdir.join('file.txt')
|
||||||
path.write(input_s)
|
path.write_binary(input_s)
|
||||||
ret = mixed_line_ending(('--fix=lf', path.strpath))
|
ret = mixed_line_ending(('--fix=lf', path.strpath))
|
||||||
|
|
||||||
assert ret == expected_retval
|
assert ret == expected_retval
|
||||||
|
|
@ -147,7 +147,7 @@ def test_mixed_line_ending_fix_force_crlf(
|
||||||
tmpdir,
|
tmpdir,
|
||||||
):
|
):
|
||||||
path = tmpdir.join('file.txt')
|
path = tmpdir.join('file.txt')
|
||||||
path.write(input_s)
|
path.write_binary(input_s)
|
||||||
ret = mixed_line_ending(('--fix=crlf', path.strpath))
|
ret = mixed_line_ending(('--fix=crlf', path.strpath))
|
||||||
|
|
||||||
assert ret == expected_retval
|
assert ret == expected_retval
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue