mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 03:26:53 +00:00
Fix crlf line endings for double-quote-string-fixer
This commit is contained in:
parent
e8e54f7f99
commit
711b730b67
2 changed files with 13 additions and 6 deletions
|
|
@ -44,8 +44,15 @@ TESTS = (
|
|||
|
||||
@pytest.mark.parametrize(('input_s', 'output', 'expected_retval'), TESTS)
|
||||
def test_rewrite(input_s, output, expected_retval, tmpdir):
|
||||
path = tmpdir.join('file.txt')
|
||||
path = tmpdir.join('file.py')
|
||||
path.write(input_s)
|
||||
retval = main([path.strpath])
|
||||
assert path.read() == output
|
||||
assert retval == expected_retval
|
||||
|
||||
|
||||
def test_rewrite_crlf(tmpdir):
|
||||
f = tmpdir.join('f.py')
|
||||
f.write_binary(b'"foo"\r\n"bar"\r\n')
|
||||
assert main((f.strpath,))
|
||||
assert f.read_binary() == b"'foo'\r\n'bar'\r\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue