From 5b03f496abf99eb33082f8b79c64c4c6106170a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20HUBSCHER?= Date: Wed, 5 Feb 2020 18:48:00 +0100 Subject: [PATCH] @asottile review. --- tests/trailing_whitespace_fixer_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/trailing_whitespace_fixer_test.py b/tests/trailing_whitespace_fixer_test.py index 4226eae..e13c4f9 100644 --- a/tests/trailing_whitespace_fixer_test.py +++ b/tests/trailing_whitespace_fixer_test.py @@ -78,6 +78,21 @@ def test_fixes_custom_ext_markdown_files(tmpdir, ext): ) +@pytest.mark.parametrize('ext', ('md', '.md', 'Md')) +def test_complex_ext_are_not_wrongly_recognized(tmpdir, ext): + path = tmpdir.join(f'test.fmd') + path.write( + 'foo \n' + 'bar \n' + 'baz \n' + '\t\n' + '\n ', + ) + ret = main((path.strpath, '--markdown-linebreak-ext={}'.format(ext))) + assert ret == 1 + assert path.read() == ('foo\nbar\nbaz\n\n\n') + + @pytest.mark.parametrize('arg', ('--', 'a/b', '')) def test_markdown_linebreak_ext_badopt(arg): with pytest.raises(SystemExit) as excinfo: